FIX: fix inconsistency in head state
TEST: test to detect incorrect handling of inner merges
FIX: put initial mark