Improved merge: all tests pass