made *_during_migrate.js a little more robust #782