intermediate fixes, Otila patch
added scratchpad local file cache, many thanks to Otila patch