Fix some osx functions