Fix incorrect merges (and make minor fixes)