Fixes for no '-i' option on RaspberryPi version of `which`

Use type instead of which where possible