Several bugfixes with Vault code, improve /importbalance