Fixed bug when allocating files to submission.