fix more MAC OSX compatibility issues