Some minor bugfixes.
Merge branch 'migration'