fixes to compiles on OSX,Linux