Migrations and fix for #46