Fix which for both BSD and OSX