small tweaks to @SteveBarnett's changes for OSX & Linux