Better handling of files in queue.