Remove lots of io:format debugging and tidy up rpc error messages