Fixed crash that could occur when there were not enough colors to fill the palette.