Fixes needMerge() and a few tests
Merge branch 'bugfix/cleanup-checkpoint-needs-merge-fix' into bugfix/cleanup-checkpoint