Fixed bug when adding files.