Rename generate_filenames into get_filenames.
Minor improvements to get_filenames.