Fix for compatibility with OSX