Fix bug in shell when called on directory