Rearrange colour table handling.
Remove debugging print statements