Migration fixes

One slight fix in the migration test code, and an extra debug related patch to the code affected by the first change.