fix some migrations bugs