Fix bug with returning filenames as a factor.