Fixed critical bug in loading directories.