Make persistent work with TypeMap.