Fix bug in hasFile()