Fix CachedDatabase for generators
Remove debugging output