Some model related fixes and migration.