Fix layout bug with palettes.