Fixes out-of-order migration problem.