Index: uspace/app/barber/barber.c
===================================================================
--- uspace/app/barber/barber.c	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/barber/barber.c	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -45,6 +45,6 @@
 #include <window.h>
 #include <canvas.h>
-#include <surface.h>
-#include <codec/tga.gz.h>
+#include <draw/surface.h>
+#include <draw/codec.h>
 #include "images.h"
 
Index: uspace/app/bdsh/cmds/modules/ls/ls.c
===================================================================
--- uspace/app/bdsh/cmds/modules/ls/ls.c	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/bdsh/cmds/modules/ls/ls.c	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -42,4 +42,5 @@
 #include <vfs/vfs.h>
 #include <str.h>
+#include <cap.h>
 
 #include "ls.h"
@@ -58,4 +59,6 @@
 	{ "unsort", no_argument, 0, 'u' },
 	{ "recursive", no_argument, 0, 'r' },
+	{ "exact-size", no_argument, 0, 'e' },
+	{ "single-column", no_argument, 0, '1' },
 	{ 0, 0, 0, 0 }
 };
@@ -63,6 +66,8 @@
 /* Prototypes for the ls command, excluding entry points. */
 static unsigned int ls_start(ls_job_t *);
-static void ls_print(struct dir_elem_t *);
-static int ls_cmp(const void *, const void *);
+static errno_t ls_print(struct dir_elem_t *);
+static errno_t ls_print_single_column(struct dir_elem_t *);
+static int ls_cmp_type_name(const void *, const void *);
+static int ls_cmp_name(const void *, const void *);
 static signed int ls_scan_dir(const char *, DIR *, struct dir_elem_t **);
 static unsigned int ls_recursive(const char *, DIR *);
@@ -74,4 +79,7 @@
 	ls->sort = 1;
 
+	ls->exact_size = false;
+	ls->single_column = false;
+	ls->printer = ls_print;
 	return 1;
 }
@@ -88,12 +96,51 @@
  * @param de		Directory element.
  */
-static void ls_print(struct dir_elem_t *de)
-{
-	if (de->s.is_file)
-		printf("%-40s\t%llu\n", de->name, (long long) de->s.size);
-	else if (de->s.is_directory)
-		printf("%-40s\t<dir>\n", de->name);
+static errno_t ls_print(struct dir_elem_t *de)
+{
+	int width = 13;
+
+	if (de->s.is_file) {
+		if (ls.exact_size) {
+			printf("%-40s\t%*llu\n", de->name, width, (long long) de->s.size);
+			return EOK;
+		}
+
+		cap_spec_t cap;
+		cap_from_blocks(de->s.size, 1, &cap);
+		cap_simplify(&cap);
+
+		char *rptr;
+		errno_t rc = cap_format(&cap, &rptr);
+		if (rc != EOK) {
+			return rc;
+		}
+
+		char *sep = str_rchr(rptr, ' ');
+		if (sep == NULL) {
+			free(rptr);
+			return ENOENT;
+		}
+
+		*sep = '\0';
+
+		printf("%-40s\t%*s %2s\n", de->name, width - 3, rptr, sep + 1);
+		free(rptr);
+	} else if (de->s.is_directory)
+		printf("%-40s\t%*s\n", de->name, width, "<dir>");
 	else
 		printf("%-40s\n", de->name);
+
+	return EOK;
+}
+
+static errno_t ls_print_single_column(struct dir_elem_t *de)
+{
+	if (de->s.is_file) {
+		printf("%s\n", de->name);
+	} else {
+		printf("%s/\n", de->name);
+	}
+
+	return EOK;
 }
 
@@ -109,5 +156,5 @@
  * @return		-1 if a < b, 1 otherwise.
  */
-static int ls_cmp(const void *a, const void *b)
+static int ls_cmp_type_name(const void *a, const void *b)
 {
 	struct dir_elem_t const *da = a;
@@ -120,4 +167,18 @@
 	else
 		return 1;
+}
+
+/** Compare directories/files per name
+ *
+ * This comparision ignores the type of
+ * the node. Sorted will strictly by name.
+ *
+ */
+static int ls_cmp_name(const void *a, const void *b)
+{
+	struct dir_elem_t const *da = a;
+	struct dir_elem_t const *db = b;
+
+	return str_cmp(da->name, db->name);
 }
 
@@ -192,9 +253,16 @@
 	}
 
-	if (ls.sort)
-		qsort(&tosort[0], nbdirs, sizeof(struct dir_elem_t), ls_cmp);
-
-	for (i = 0; i < nbdirs; i++)
-		ls_print(&tosort[i]);
+	if (ls.sort) {
+		int (*compar)(const void *, const void *);
+		compar = ls.single_column ? ls_cmp_name : ls_cmp_type_name;
+		qsort(&tosort[0], nbdirs, sizeof(struct dir_elem_t), compar);
+	}
+
+	for (i = 0; i < nbdirs; i++) {
+		if (ls.printer(&tosort[i]) != EOK) {
+			cli_error(CL_ENOMEM, "%s: Out of memory", cmdname);
+			goto out;
+		}
+	}
 
 	/* Populate the directory list. */
@@ -333,7 +401,9 @@
 		    "If not path is given, the current working directory is used.\n"
 		    "Options:\n"
-		    "  -h, --help       A short option summary\n"
-		    "  -u, --unsort     Do not sort directory entries\n"
-		    "  -r, --recursive  List subdirectories recursively\n",
+		    "  -h, --help            A short option summary\n"
+		    "  -u, --unsort          Do not sort directory entries\n"
+		    "  -r, --recursive       List subdirectories recursively\n"
+		    "  -e, --exact-size      File sizes will be unformatted (raw bytes count)\n"
+		    "  -1, --single-column   Only the names will be returned\n",
 		    cmdname);
 	}
@@ -364,5 +434,5 @@
 
 	while (c != -1) {
-		c = getopt_long(argc, argv, "hur", long_options, &opt_ind);
+		c = getopt_long(argc, argv, "hure1", long_options, &opt_ind);
 		switch (c) {
 		case 'h':
@@ -375,4 +445,11 @@
 			ls.recursive = 1;
 			break;
+		case 'e':
+			ls.exact_size = true;
+			break;
+		case '1':
+			ls.single_column = true;
+			ls.printer = ls_print_single_column;
+			break;
 		}
 	}
@@ -400,5 +477,8 @@
 	switch (scope) {
 	case LS_FILE:
-		ls_print(&de);
+		if (ls.printer(&de) != EOK) {
+			cli_error(CL_ENOMEM, "%s: Out of memory", cmdname);
+			return CMD_FAILURE;
+		}
 		break;
 	case LS_DIR:
Index: uspace/app/bdsh/cmds/modules/ls/ls.h
===================================================================
--- uspace/app/bdsh/cmds/modules/ls/ls.h	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/bdsh/cmds/modules/ls/ls.h	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -8,11 +8,4 @@
 #define LS_FILE  1
 #define LS_DIR   2
-
-typedef struct {
-	/* Options set at runtime. */
-	unsigned int recursive;
-	unsigned int sort;
-
-} ls_job_t;
 
 /** Structure to represent a directory entry.
@@ -26,3 +19,14 @@
 };
 
+typedef struct {
+	/* Options set at runtime. */
+	unsigned int recursive;
+	unsigned int sort;
+
+	bool single_column;
+	bool exact_size;
+
+	errno_t (*printer)(struct dir_elem_t *);
+} ls_job_t;
+
 #endif
Index: uspace/app/bdsh/compl.c
===================================================================
--- uspace/app/bdsh/compl.c	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/bdsh/compl.c	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -42,4 +42,5 @@
 #include "exec.h"
 #include "tok.h"
+#include "util.h"
 
 static errno_t compl_init(wchar_t *text, size_t pos, size_t *cstart, void **state);
@@ -214,6 +215,4 @@
 		}
 		*cstart += rpath_sep + 1 - prefix;
-		free(prefix);
-		prefix = NULL;
 
 		cs->path_list = malloc(sizeof(char *) * 2);
@@ -222,5 +221,22 @@
 			goto error;
 		}
-		cs->path_list[0] = dirname;
+
+		if (!is_path(prefix) && cs->is_command) {
+			cs->path_list[0] = malloc(sizeof(char) * PATH_MAX);
+			if (cs->path_list[0] == NULL) {
+				retval = ENOMEM;
+				goto error;
+			}
+
+			int ret = snprintf(cs->path_list[0], PATH_MAX, "%s/%s", search_dir[0], dirname);
+			if (ret < 0 || ret >= PATH_MAX) {
+				retval = ENOMEM;
+				goto error;
+			}
+		} else {
+			cs->path_list[0] = dirname;
+		}
+
+		free(prefix);
 		cs->path_list[1] = NULL;
 		/*
Index: uspace/app/bdsh/exec.c
===================================================================
--- uspace/app/bdsh/exec.c	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/bdsh/exec.c	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -47,8 +47,5 @@
 #include "errors.h"
 
-/* FIXME: Just have find_command() return an allocated string */
-static char *found;
-
-static char *find_command(char *);
+static errno_t find_command(char *, char **);
 static int try_access(const char *);
 
@@ -68,30 +65,48 @@
 }
 
-/** Returns the full path of "cmd" if cmd is found
+/** Returns EOK if no internal failure or else ENOMEM
  *
- * else just hand back cmd as it was presented
+ * When the parameter `cmd` can be found then the absolute path will be set in `found`.
+ * Or else `found` will be NULL.
+ * `found` will be newly allocated and must be freed by the caller
  */
-static char *find_command(char *cmd)
+static errno_t find_command(char *cmd, char **found)
 {
-	size_t i;
+	/* The user has specified a full or relative path, just give it back. */
+	if (is_path(cmd)) {
+		if (-1 != try_access(cmd)) {
+			*found = str_dup(cmd);
+			return EOK;
+		}
 
-	found = (char *)malloc(PATH_MAX);
+		*found = NULL;
+		return EOK;
+	}
 
-	/* The user has specified a full or relative path, just give it back. */
-	if (-1 != try_access(cmd)) {
-		return (char *) cmd;
+	*found = (char *)malloc(PATH_MAX);
+	if (*found == NULL) {
+		return ENOMEM;
 	}
 
 	/* We now have n places to look for the command */
+	size_t i;
+	size_t cmd_length = str_length(cmd);
 	for (i = 0; search_dir[i] != NULL; i++) {
-		memset(found, 0, PATH_MAX);
-		snprintf(found, PATH_MAX, "%s/%s", search_dir[i], cmd);
-		if (-1 != try_access(found)) {
-			return (char *) found;
+		if (str_length(search_dir[i]) + cmd_length + 2 > PATH_MAX) {
+			free(*found);
+			return ENOMEM;
+		}
+
+		memset(*found, 0, PATH_MAX);
+		snprintf(*found, PATH_MAX, "%s/%s", search_dir[i], cmd);
+		if (-1 != try_access(*found)) {
+			return EOK;
 		}
 	}
+	free(*found);
+	*found = NULL;
 
-	/* We didn't find it, just give it back as-is. */
-	return (char *) cmd;
+	/* We didn't find it, return NULL */
+	return EOK;
 }
 
@@ -107,6 +122,14 @@
 	FILE *files[3];
 
-	tmp = str_dup(find_command(cmd));
-	free(found);
+	rc = find_command(cmd, &tmp);
+	if (rc != EOK) {
+		cli_error(CL_ENOMEM, "%s: failure executing find_command()", progname);
+		return 1;
+	}
+
+	if (tmp == NULL) {
+		cli_error(CL_EEXEC, "%s: Command not found '%s'", progname, cmd);
+		return 1;
+	}
 
 	files[0] = io->stdin;
Index: uspace/app/bdsh/util.c
===================================================================
--- uspace/app/bdsh/util.c	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/bdsh/util.c	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -74,2 +74,15 @@
 	return 0;
 }
+
+/*
+ * Returns true if the string is a relative or an absolute path
+ */
+bool is_path(const char *cmd)
+{
+
+	bool ret = str_lcmp(cmd, "/", 1) == 0;
+	ret = ret || str_lcmp(cmd, "./", 2) == 0;
+	ret = ret || str_lcmp(cmd, "../", 3) == 0;
+
+	return ret;
+}
Index: uspace/app/bdsh/util.h
===================================================================
--- uspace/app/bdsh/util.h	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/bdsh/util.h	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -31,8 +31,10 @@
 
 #include "scli.h"
+#include <stdbool.h>
 
 /* Utility functions */
 extern unsigned int cli_count_args(char **);
 extern unsigned int cli_set_prompt(cliuser_t *usr);
+extern bool is_path(const char *cmd);
 
 #endif
Index: uspace/app/contacts/contacts.c
===================================================================
--- uspace/app/contacts/contacts.c	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/contacts/contacts.c	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -526,5 +526,5 @@
 {
 	errno_t rc;
-	contacts_t *contacts;
+	contacts_t *contacts = NULL;
 
 	rc = contacts_open("contacts.sif", &contacts);
Index: uspace/app/df/df.c
===================================================================
--- uspace/app/df/df.c	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/df/df.c	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -70,5 +70,5 @@
 
 	/* Parse command-line options */
-	while ((optres = getopt(argc, argv, ":ubh")) != -1) {
+	while ((optres = getopt(argc, argv, "ubh")) != -1) {
 		switch (optres) {
 		case 'h':
@@ -78,10 +78,4 @@
 		case 'b':
 			display_blocks = true;
-			break;
-
-		case ':':
-			fprintf(stderr, "Option -%c requires an operand\n",
-			    optopt);
-			errflg++;
 			break;
 
Index: uspace/app/fontviewer/fontviewer.c
===================================================================
--- uspace/app/fontviewer/fontviewer.c	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/fontviewer/fontviewer.c	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -41,10 +41,9 @@
 #include <window.h>
 #include <canvas.h>
-#include <surface.h>
-#include <codec/tga.h>
+#include <draw/surface.h>
+#include <draw/codec.h>
 #include <task.h>
-#include <drawctx.h>
-#include <font/embedded.h>
-#include <font/pcf.h>
+#include <draw/drawctx.h>
+#include <draw/font.h>
 #include <stdarg.h>
 #include <io/verify.h>
Index: uspace/app/hbench/env.c
===================================================================
--- uspace/app/hbench/env.c	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/hbench/env.c	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -52,14 +52,14 @@
 }
 
-static size_t param_key_hash(void *key)
+static size_t param_key_hash(const void *key)
 {
-	char *key_str = key;
+	const char *key_str = key;
 	return str_size(key_str);
 }
 
-static bool param_key_equal(void *key, const ht_link_t *item)
+static bool param_key_equal(const void *key, const ht_link_t *item)
 {
 	param_t *param = hash_table_get_inst(item, param_t, link);
-	char *key_str = key;
+	const char *key_str = key;
 
 	return str_cmp(param->key, key_str) == 0;
Index: uspace/app/kio/kio.c
===================================================================
--- uspace/app/kio/kio.c	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/kio/kio.c	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -164,7 +164,7 @@
 	fibril_mutex_lock(&mtx);
 
-	size_t kio_start = (size_t) IPC_GET_ARG1(*call);
-	size_t kio_len = (size_t) IPC_GET_ARG2(*call);
-	size_t kio_stored = (size_t) IPC_GET_ARG3(*call);
+	size_t kio_start = (size_t) ipc_get_arg1(call);
+	size_t kio_len = (size_t) ipc_get_arg2(call);
+	size_t kio_stored = (size_t) ipc_get_arg3(call);
 
 	size_t offset = (kio_start + kio_len - kio_stored) % kio_length;
Index: uspace/app/taskdump/symtab.c
===================================================================
--- uspace/app/taskdump/symtab.c	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/taskdump/symtab.c	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -215,5 +215,5 @@
 			continue;
 
-		stype = ELF_ST_TYPE(st->sym[i].st_info);
+		stype = elf_st_type(st->sym[i].st_info);
 		if (stype != STT_OBJECT && stype != STT_FUNC)
 			continue;
@@ -257,5 +257,5 @@
 			continue;
 
-		stype = ELF_ST_TYPE(st->sym[i].st_info);
+		stype = elf_st_type(st->sym[i].st_info);
 		if (stype != STT_OBJECT && stype != STT_FUNC &&
 		    stype != STT_NOTYPE) {
Index: uspace/app/trace/ipcp.c
===================================================================
--- uspace/app/trace/ipcp.c	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/trace/ipcp.c	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -72,8 +72,8 @@
 proto_t	*proto_unknown;		/**< Protocol with no known methods. */
 
-static size_t pending_call_key_hash(void *key)
-{
-	cap_call_handle_t *chandle = (cap_call_handle_t *) key;
-	return CAP_HANDLE_RAW(*chandle);
+static size_t pending_call_key_hash(const void *key)
+{
+	const cap_call_handle_t *chandle = key;
+	return cap_handle_raw(*chandle);
 }
 
@@ -81,10 +81,10 @@
 {
 	pending_call_t *hs = hash_table_get_inst(item, pending_call_t, link);
-	return CAP_HANDLE_RAW(hs->call_handle);
-}
-
-static bool pending_call_key_equal(void *key, const ht_link_t *item)
-{
-	cap_call_handle_t *chandle = (cap_call_handle_t *) key;
+	return cap_handle_raw(hs->call_handle);
+}
+
+static bool pending_call_key_equal(const void *key, const ht_link_t *item)
+{
+	const cap_call_handle_t *chandle = key;
 	pending_call_t *hs = hash_table_get_inst(item, pending_call_t, link);
 
@@ -104,16 +104,16 @@
 	// XXX: there is no longer a limit on the number of phones as phones are
 	// now handled using capabilities
-	if (CAP_HANDLE_RAW(phone) < 0 || CAP_HANDLE_RAW(phone) >= MAX_PHONE)
+	if (cap_handle_raw(phone) < 0 || cap_handle_raw(phone) >= MAX_PHONE)
 		return;
-	connections[CAP_HANDLE_RAW(phone)].server = server;
-	connections[CAP_HANDLE_RAW(phone)].proto = proto;
-	have_conn[CAP_HANDLE_RAW(phone)] = 1;
+	connections[cap_handle_raw(phone)].server = server;
+	connections[cap_handle_raw(phone)].proto = proto;
+	have_conn[cap_handle_raw(phone)] = 1;
 }
 
 void ipcp_connection_clear(cap_phone_handle_t phone)
 {
-	have_conn[CAP_HANDLE_RAW(phone)] = 0;
-	connections[CAP_HANDLE_RAW(phone)].server = 0;
-	connections[CAP_HANDLE_RAW(phone)].proto = NULL;
+	have_conn[cap_handle_raw(phone)] = 0;
+	connections[cap_handle_raw(phone)].server = 0;
+	connections[cap_handle_raw(phone)].proto = NULL;
 }
 
@@ -184,6 +184,6 @@
 	int i;
 
-	if (have_conn[CAP_HANDLE_RAW(phandle)])
-		proto = connections[CAP_HANDLE_RAW(phandle)].proto;
+	if (have_conn[cap_handle_raw(phandle)])
+		proto = connections[cap_handle_raw(phandle)].proto;
 	else
 		proto = NULL;
@@ -194,5 +194,5 @@
 		printf("Call handle: %p, phone: %p, proto: %s, method: ",
 		    chandle, phandle, (proto ? proto->name : "n/a"));
-		ipc_m_print(proto, IPC_GET_IMETHOD(*call));
+		ipc_m_print(proto, ipc_get_imethod(call));
 		printf(" args: (%" PRIun ", %" PRIun ", %" PRIun ", "
 		    "%" PRIun ", %" PRIun ")\n",
@@ -203,5 +203,5 @@
 
 		if (proto != NULL) {
-			oper = proto_get_oper(proto, IPC_GET_IMETHOD(*call));
+			oper = proto_get_oper(proto, ipc_get_imethod(call));
 		} else {
 			oper = NULL;
@@ -262,6 +262,6 @@
 
 	phone = pcall->phone_handle;
-	method = IPC_GET_IMETHOD(pcall->question);
-	retval = IPC_GET_RETVAL(*answer);
+	method = ipc_get_imethod(&pcall->question);
+	retval = ipc_get_retval(answer);
 
 	resp = answer->args;
@@ -270,7 +270,7 @@
 		printf("Response to %p: retval=%s, args = (%" PRIun ", "
 		    "%" PRIun ", %" PRIun ", %" PRIun ", %" PRIun ")\n",
-		    call_handle, str_error_name(retval), IPC_GET_ARG1(*answer),
-		    IPC_GET_ARG2(*answer), IPC_GET_ARG3(*answer),
-		    IPC_GET_ARG4(*answer), IPC_GET_ARG5(*answer));
+		    call_handle, str_error_name(retval), ipc_get_arg1(answer),
+		    ipc_get_arg2(answer), ipc_get_arg3(answer),
+		    ipc_get_arg4(answer), ipc_get_arg5(answer));
 	}
 
@@ -305,10 +305,10 @@
 	    (retval == 0)) {
 		/* Connected to a service (through NS) */
-		service = IPC_GET_ARG2(pcall->question);
+		service = ipc_get_arg2(&pcall->question);
 		proto = proto_get_by_srv(service);
 		if (proto == NULL)
 			proto = proto_unknown;
 
-		cphone = (cap_phone_handle_t) IPC_GET_ARG5(*answer);
+		cphone = (cap_phone_handle_t) ipc_get_arg5(answer);
 		if ((display_mask & DM_SYSTEM) != 0) {
 			printf("Registering connection (phone %p, protocol: %s)\n", cphone,
Index: uspace/app/trace/proto.c
===================================================================
--- uspace/app/trace/proto.c	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/trace/proto.c	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -57,7 +57,8 @@
 /* Hash table operations. */
 
-static size_t srv_proto_key_hash(void *key)
-{
-	return *(int *)key;
+static size_t srv_proto_key_hash(const void *key)
+{
+	const int *n = key;
+	return *n;
 }
 
@@ -68,8 +69,9 @@
 }
 
-static bool srv_proto_key_equal(void *key, const ht_link_t *item)
-{
+static bool srv_proto_key_equal(const void *key, const ht_link_t *item)
+{
+	const int *n = key;
 	srv_proto_t *sp = hash_table_get_inst(item, srv_proto_t, link);
-	return sp->srv == *(int *)key;
+	return sp->srv == *n;
 }
 
@@ -82,7 +84,8 @@
 };
 
-static size_t method_oper_key_hash(void *key)
-{
-	return *(int *)key;
+static size_t method_oper_key_hash(const void *key)
+{
+	const int *n = key;
+	return *n;
 }
 
@@ -93,8 +96,9 @@
 }
 
-static bool method_oper_key_equal(void *key, const ht_link_t *item)
-{
+static bool method_oper_key_equal(const void *key, const ht_link_t *item)
+{
+	const int *n = key;
 	method_oper_t *mo = hash_table_get_inst(item, method_oper_t, link);
-	return mo->method == *(int *)key;
+	return mo->method == *n;
 }
 
Index: uspace/app/trace/trace.c
===================================================================
--- uspace/app/trace/trace.c	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/trace/trace.c	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -302,10 +302,10 @@
 	phandle = (cap_phone_handle_t) sc_args[0];
 
-	IPC_SET_IMETHOD(call, sc_args[1]);
-	IPC_SET_ARG1(call, sc_args[2]);
-	IPC_SET_ARG2(call, sc_args[3]);
-	IPC_SET_ARG3(call, sc_args[4]);
-	IPC_SET_ARG4(call, sc_args[5]);
-	IPC_SET_ARG5(call, 0);
+	ipc_set_imethod(&call, sc_args[1]);
+	ipc_set_arg1(&call, sc_args[2]);
+	ipc_set_arg2(&call, sc_args[3]);
+	ipc_set_arg3(&call, sc_args[4]);
+	ipc_set_arg4(&call, sc_args[5]);
+	ipc_set_arg5(&call, 0);
 
 	ipcp_call_out(phandle, &call, 0);
Index: uspace/app/viewer/viewer.c
===================================================================
--- uspace/app/viewer/viewer.c	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/viewer/viewer.c	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -41,6 +41,6 @@
 #include <window.h>
 #include <canvas.h>
-#include <surface.h>
-#include <codec/tga.h>
+#include <draw/surface.h>
+#include <draw/codec.h>
 #include <task.h>
 #include <str.h>
Index: uspace/app/vlaunch/vlaunch.c
===================================================================
--- uspace/app/vlaunch/vlaunch.c	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/vlaunch/vlaunch.c	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -46,8 +46,8 @@
 #include <canvas.h>
 
-#include <surface.h>
-#include <source.h>
-#include <drawctx.h>
-#include <codec/tga.h>
+#include <draw/surface.h>
+#include <draw/source.h>
+#include <draw/drawctx.h>
+#include <draw/codec.h>
 
 #include "images.h"
Index: uspace/app/wavplay/dplay.c
===================================================================
--- uspace/app/wavplay/dplay.c	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/wavplay/dplay.c	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -103,8 +103,8 @@
 		async_get_call(&call);
 
-		switch (IPC_GET_IMETHOD(call)) {
+		switch (ipc_get_imethod(&call)) {
 		case PCM_EVENT_PLAYBACK_STARTED:
 		case PCM_EVENT_FRAMES_PLAYED:
-			printf("%" PRIun " frames: ", IPC_GET_ARG1(call));
+			printf("%" PRIun " frames: ", ipc_get_arg1(&call));
 			async_answer_0(&call, EOK);
 			break;
@@ -118,5 +118,5 @@
 			return;
 		default:
-			printf("Unknown event %" PRIun ".\n", IPC_GET_IMETHOD(call));
+			printf("Unknown event %" PRIun ".\n", ipc_get_imethod(&call));
 			async_answer_0(&call, ENOTSUP);
 			continue;
Index: uspace/app/wavplay/drec.c
===================================================================
--- uspace/app/wavplay/drec.c	(revision 46288eef683d4b03bcbb084da70081298922bd22)
+++ uspace/app/wavplay/drec.c	(revision 9fb280c18d7a3aadce7085e013cc9625098ea17e)
@@ -103,5 +103,5 @@
 		async_get_call(&call);
 
-		switch (IPC_GET_IMETHOD(call)) {
+		switch (ipc_get_imethod(&call)) {
 		case PCM_EVENT_CAPTURE_TERMINATED:
 			printf("Recording terminated\n");
@@ -109,8 +109,8 @@
 			break;
 		case PCM_EVENT_FRAMES_CAPTURED:
-			printf("%" PRIun " frames\n", IPC_GET_ARG1(call));
+			printf("%" PRIun " frames\n", ipc_get_arg1(&call));
 			break;
 		default:
-			printf("Unknown event %" PRIun ".\n", IPC_GET_IMETHOD(call));
+			printf("Unknown event %" PRIun ".\n", ipc_get_imethod(&call));
 			async_answer_0(&call, ENOTSUP);
 			continue;
