fixing a few template compile errors that only appeared on OSX
a bit more cleaning up on the mac