Merging from master.
Fixes some bad mergetool output, unit tests.

The mergetool didn't remove some of the conflicts
after resolution.

Fixes a couple of failing tests.