Merged in changes from research branch