more tweaks to get this working in linux vs osx