Fixing migration bugs