Unit tests and fixes for colour conversion incorrectness.