Fix migration to be internally consistent