Repair the bip32 key generator
Add missing const specifiers
Do not use ternary operator