Many fixes; working (but slow) getColor function.