fixing some bad syntax and missed variables/merge markers during merge