Fix for osx build, thanks to beenal.