fix some merge incompatibilities and bad function usage