json rpc for wallet and bugfix