Fix for OSX crash