Fix small issues on the multisig code.
Add tests for multisig.