Try to avoid using which

For some reason it seems to break in buildbot with output
redirected.