Various fixes.
Added migration.