Fix handling of the color cache
Merge pull request #1730 from elemoine/colorcache

Fix handling of the color cache