Fixes #5 (directory traversal) and fixes a runtime error in the previous commit if the file or directory requested does not exist