Fixes to cacheing