More work on merge script.

Some minor bugfixes.
Some subtle changes in colour meaning.