Better error handling when in the wrong directory