Tweaks to compile on OSX