Codebook correction