Improve unit test, and fix HTTPPeer RPC