fixes to get dircache file writing working