Final fixes to RPC refactoring