Fixed issue with false conflicts being signaled when both branches had made exactly the same change

Fixes #507

Includes some code cleaning