theft from basiccache; fixes #8, fixes #13