Fixing issue with testing for files/directories