Add basic_rpc_dispatcher, fix minor bugs