Palette selection bug fix