Fix bug involving color assignment to contours