Fix codebook formatting