Switch to using command -v to check for commands instead of which