fixes to compile on mac