Merged changes from Stephen