Minor bugfix and workaround for rpc error