Fix fast forward merge behavior.
Enhance merge test coverage to better test possible outcomes.