Fix up migration test and associated bugs.