Little fixes to cache interface, in order to have cache accept and
return concrete types.