Changed slightly the logic of scanning temp and input dirs
Changed slightly the logic of scanning temp and input dirs