Fix palette field writing