Fix silent crash handling a request for a directory