small OSX compatibility fixes