More tweaks and fixes across OS X + linux