Attempt to fix a bug with correctly recognizing different file types in by_files attribtue.