slight changes to compile on OSX