Correcting the codebook