Fix the build, improve types
Improve migrator tests