Error with non-directories fixed

If any non-directory would be in the list, the program wouldn't start.
Fixed that shit.