Potential fix for segfault on OSX