Minor refactoring.
Some more keysig refactoring.
Fixed warning.