Crude merge of trunk to refactor-db