Updated to compile on OSX