0.9 migration

This pull request is for merging the changes in 0.8.6-migration into 0.9-migration.