fix bugs in merge skipping