Various fixes to merge