Fixed error with color encoding