Improve context printing (more like old style).
Don't touch bad memory when color palette includes duplicates.

Wow, duh. Mike Hurwitz report.
Avoid bogus 'color not in colormap' warning.