Fixed various migration functions

To keep the migration functions up to date with the latest build of the libraries.