Index: uspace/lib/hound/include/hound/protocol.h
===================================================================
--- uspace/lib/hound/include/hound/protocol.h	(revision a8c7a6db104b3034fcb48a209245b42dec31768b)
+++ uspace/lib/hound/include/hound/protocol.h	(revision fed5a9b5f65e62d1606031ba5f462ca39ca10bcf)
@@ -58,19 +58,9 @@
 typedef intptr_t hound_context_id_t;
 
-/**
- * Check context id for errors.
- * @param id Context id
- * @return Error code.
- */
-static inline int hound_context_id_err(hound_context_id_t id)
-{
-	return id > 0 ? EOK : (id == 0 ? ENOENT : id);
-}
-
 hound_sess_t *hound_service_connect(const char *service);
 void hound_service_disconnect(hound_sess_t *sess);
 
-hound_context_id_t hound_service_register_context(hound_sess_t *sess,
-    const char *name, bool record);
+int hound_service_register_context(hound_sess_t *sess,
+    const char *name, bool record, hound_context_id_t *id);
 int hound_service_unregister_context(hound_sess_t *sess, hound_context_id_t id);
 
Index: uspace/lib/hound/src/client.c
===================================================================
--- uspace/lib/hound/src/client.c	(revision a8c7a6db104b3034fcb48a209245b42dec31768b)
+++ uspace/lib/hound/src/client.c	(revision fed5a9b5f65e62d1606031ba5f462ca39ca10bcf)
@@ -123,7 +123,8 @@
 			return NULL;
 		}
-		new_context->id = hound_service_register_context(
-		    new_context->session, new_context->name, record);
-		if (hound_context_id_err(new_context->id) != EOK) {
+		int rc = hound_service_register_context(
+		    new_context->session, new_context->name, record,
+		    &new_context->id);
+		if (rc != EOK) {
 			hound_service_disconnect(new_context->session);
 			free(new_context->name);
Index: uspace/lib/hound/src/protocol.c
===================================================================
--- uspace/lib/hound/src/protocol.c	(revision a8c7a6db104b3034fcb48a209245b42dec31768b)
+++ uspace/lib/hound/src/protocol.c	(revision fed5a9b5f65e62d1606031ba5f462ca39ca10bcf)
@@ -115,8 +115,11 @@
  * @param name Valid string identifier
  * @param record True if the application context wishes to receive data.
- * @return Valid ID on success, Error code on failure.
- */
-hound_context_id_t hound_service_register_context(hound_sess_t *sess,
-    const char *name, bool record)
+ *
+ * @param[out] id  Return context ID.
+ *
+ * @return EOK on success, Error code on failure.
+ */
+int hound_service_register_context(hound_sess_t *sess,
+    const char *name, bool record, hound_context_id_t *id)
 {
 	assert(sess);
@@ -126,5 +129,5 @@
 	aid_t mid =
 	    async_send_1(exch, IPC_M_HOUND_CONTEXT_REGISTER, record, &call);
-	int ret = mid ? EOK : EPARTY;
+	sysarg_t ret = mid ? EOK : EPARTY;
 
 	if (ret == EOK)
@@ -134,8 +137,12 @@
 
 	if (ret == EOK)
-		async_wait_for(mid, (sysarg_t *)&ret);
+		async_wait_for(mid, &ret);
 
 	async_exchange_end(exch);
-	return ret == EOK ? (hound_context_id_t)IPC_GET_ARG1(call) : ret;
+	if (ret == EOK) {
+		*id = (hound_context_id_t)IPC_GET_ARG1(call);
+	}
+
+	return ret;
 }
 
@@ -184,5 +191,5 @@
 	    (bool)connection, &res_call);
 
-	int ret = EOK;
+	sysarg_t ret = EOK;
 	if (mid && connection)
 		ret = async_data_write_start(exch, connection,
@@ -190,5 +197,5 @@
 
 	if (ret == EOK)
-		async_wait_for(mid, (sysarg_t*)&ret);
+		async_wait_for(mid, &ret);
 
 	if (ret != EOK) {
@@ -252,10 +259,10 @@
 	ipc_call_t call;
 	aid_t id = async_send_0(exch, IPC_M_HOUND_CONNECT, &call);
-	int ret = id ? EOK : EPARTY;
+	sysarg_t ret = id ? EOK : EPARTY;
 	if (ret == EOK)
 		ret = async_data_write_start(exch, source, str_size(source));
 	if (ret == EOK)
 		ret = async_data_write_start(exch, sink, str_size(sink));
-	async_wait_for(id, (sysarg_t*)&ret);
+	async_wait_for(id, &ret);
 	async_exchange_end(exch);
 	return ret;
@@ -278,10 +285,10 @@
 	ipc_call_t call;
 	aid_t id = async_send_0(exch, IPC_M_HOUND_DISCONNECT, &call);
-	int ret = id ? EOK : EPARTY;
+	sysarg_t ret = id ? EOK : EPARTY;
 	if (ret == EOK)
 		ret = async_data_write_start(exch, source, str_size(source));
 	if (ret == EOK)
 		ret = async_data_write_start(exch, sink, str_size(sink));
-	async_wait_for(id, (sysarg_t*)&ret);
+	async_wait_for(id, &ret);
 	async_exchange_end(exch);
 	return ENOTSUP;
