Minor refactoring.
Some more keysig refactoring.