Fixes on migration functions