Fixed system scope dependencies
Fixed potential NPEs due to use of FIle.listFiles()
Ensure all directories are created ahead of time