Fix error response for remote procedure calls.
Rewrite #4.