WYRL: lots of bug fixes for Automaton.canonicalise() method.