Minor bug fix to files.py