Fixing osx bugs