fixes to merging code