Fixing bug in creation of cache keys tuple