Fix cache issues with cache not being cleared per directory when a
directory's contents are changed.  Also fix mkdir calls.