adapted test for rpc and fixed some small bugs