Minor optimizations and fixed color saturation bug.