Bug fix to migration