Changes to get code to compile on OSX