Merge of changes from Aa-ron's branch.