Fixed bugs in migrations, now new database can be initialized successfully