Fixing a bug in the migration script (I SHOULD have validated this before checking my 'quick fix' in)