Fixed bug in file search routine