Makes listdir() return valid filenames