Fix a bug in the palette decoder