Fixed output redirect for "which"

Credits go to @jalung . Closes #231 .