Some more improvements to schema migration