Fixing issues in DatabaseMigration.py