Migration fixes

One small fix in the migration test code, and an extra debug related patch.