minor fixes for OSX compatibility