#49 Bug fixes to buildCaches script involving creating directories if do not exist