Fix sometimes incorrectly ordered color keys. (Fixes #195)