various minor fixes

  - make sure entire cache directory path is created
  - fix typo in mkdir
  - fix error that mkdir cannot be found in chroot
Merge pull request #1 from ganto/master

various minor fixes