added fixes for OSX