Issue #488: Onset migrator can fail in certain cases
Better fix
(cherry picked from commit df41ab9ed13a85345d6a4eb4550fb97469688f93)