Fixed to work with a lot of files