bugfixes in 'getbalance' and elsewhere