Fix migration issue, leaner check_for_end