Fix bad migrations

As noted in issue #63 there are problems with eg. test cases and the current migrations. Here are some fixings.