Index: kernel/Makefile
===================================================================
--- kernel/Makefile	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ kernel/Makefile	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -226,5 +226,4 @@
 	generic/src/proc/task.c \
 	generic/src/proc/the.c \
-	generic/src/proc/tasklet.c \
 	generic/src/syscall/syscall.c \
 	generic/src/syscall/copy.c \
@@ -382,5 +381,4 @@
 		generic/src/main/kinit.c \
 		generic/src/proc/the.c \
-		generic/src/proc/tasklet.c \
 		generic/src/mm/frame.c \
 		generic/src/mm/page.c \
Index: kernel/arch/mips32/include/atomic.h
===================================================================
--- kernel/arch/mips32/include/atomic.h	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ kernel/arch/mips32/include/atomic.h	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -91,4 +91,5 @@
 		"	sc %0, %1\n"
 		"	beqz %0, 1b\n"
+		"	nop\n"
 		"2:\n"
 		: "=&r" (tmp),
Index: kernel/generic/include/ipc/ipc.h
===================================================================
--- kernel/generic/include/ipc/ipc.h	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ kernel/generic/include/ipc/ipc.h	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -115,4 +115,10 @@
  */
 #define IPC_FF_ROUTE_FROM_ME  (1 << 0)
+
+/* Data transfer flags. */
+#define IPC_XF_NONE		0
+
+/** Restrict the transfer size if necessary. */
+#define IPC_XF_RESTRICT		(1 << 0)
 
 /** Kernel IPC interfaces
Index: rnel/generic/include/proc/tasklet.h
===================================================================
--- kernel/generic/include/proc/tasklet.h	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ 	(revision )
@@ -1,73 +1,0 @@
-/*
- * Copyright (c) 2007 Jan Hudecek
- * Copyright (c) 2008 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup genericproc
- * @{
- */
-/** @file tasklet.h
- * @brief Tasklets declarations
- */
-
-#ifndef KERN_TASKLET_H_
-#define KERN_TASKLET_H_
-
-#include <adt/list.h>
-
-/** Tasklet callback type */
-typedef void (* tasklet_callback_t)(void *arg);
-
-/** Tasklet state */
-typedef enum {
-	NotActive,
-	Scheduled,
-	InProgress,
-	Disabled
-} tasklet_state_t;
-
-/** Structure describing a tasklet */
-typedef struct tasklet_descriptor {
-	link_t link;
-	
-	/** Callback to call */
-	tasklet_callback_t callback;
-	
-	/** Argument passed to the callback */
-	void *arg;
-	
-	/** State of the tasklet */
-	tasklet_state_t state;
-} tasklet_descriptor_t;
-
-
-extern void tasklet_init(void);
-
-#endif
-
-/** @}
- */
Index: kernel/generic/src/ipc/sysipc.c
===================================================================
--- kernel/generic/src/ipc/sysipc.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ kernel/generic/src/ipc/sysipc.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -426,7 +426,13 @@
 	case IPC_M_DATA_READ: {
 		size_t size = IPC_GET_ARG2(call->data);
-		if ((size <= 0 || (size > DATA_XFER_LIMIT)))
+		if (size <= 0)
 			return ELIMIT;
-		
+		if (size > DATA_XFER_LIMIT) {
+			int flags = IPC_GET_ARG3(call->data);
+			if (flags & IPC_XF_RESTRICT)
+				IPC_SET_ARG2(call->data, DATA_XFER_LIMIT);
+			else
+				return ELIMIT;
+		}
 		break;
 	}
@@ -435,6 +441,12 @@
 		size_t size = IPC_GET_ARG2(call->data);
 		
-		if (size > DATA_XFER_LIMIT)
-			return ELIMIT;
+		if (size > DATA_XFER_LIMIT) {
+			int flags = IPC_GET_ARG3(call->data);
+			if (flags & IPC_XF_RESTRICT) {
+				size = DATA_XFER_LIMIT;
+				IPC_SET_ARG2(call->data, size);
+			} else
+				return ELIMIT;
+		}
 		
 		call->buffer = (uint8_t *) malloc(size, 0);
Index: kernel/generic/src/main/main.c
===================================================================
--- kernel/generic/src/main/main.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ kernel/generic/src/main/main.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -58,5 +58,4 @@
 #include <proc/thread.h>
 #include <proc/task.h>
-#include <proc/tasklet.h>
 #include <main/kinit.h>
 #include <main/version.h>
@@ -217,5 +216,4 @@
 	tlb_init();
 	ddi_init();
-	tasklet_init();
 	arch_post_mm_init();
 	arch_pre_smp_init();
Index: rnel/generic/src/proc/tasklet.c
===================================================================
--- kernel/generic/src/proc/tasklet.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/*
- * Copyright (c) 2007 Jan Hudecek
- * Copyright (c) 2008 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup genericproc
- * @{
- */
-/** @file tasklet.c
- *  @brief Tasklet implementation
- */
-
-#include <proc/tasklet.h>
-#include <synch/spinlock.h>
-#include <mm/slab.h>
-#include <config.h>
-
-/** Spinlock protecting list of tasklets */
-SPINLOCK_INITIALIZE(tasklet_lock);
-
-/** Array of tasklet lists for every CPU */
-tasklet_descriptor_t **tasklet_list;
-
-void tasklet_init(void)
-{
-	unsigned int i;
-	
-	tasklet_list = malloc(sizeof(tasklet_descriptor_t *) * config.cpu_count, 0);
-	if (!tasklet_list)
-		panic("Error initializing tasklets.");
-	
-	for (i = 0; i < config.cpu_count; i++)
-		tasklet_list[i] = NULL;
-	
-	spinlock_initialize(&tasklet_lock, "tasklet_lock");
-}
-
-
-/** @}
- */
Index: uspace/app/bdsh/cmds/modules/cat/cat.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cat/cat.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/app/bdsh/cmds/modules/cat/cat.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -195,5 +195,5 @@
 					wchar_t c = str_decode(buff, &offset, bytes);
 					if (c == 0) {
-						// reached end of string
+						/* Reached end of string */
 						break;
 					}
@@ -228,6 +228,8 @@
 	int rc;
 	
-	// reset global state
-	// TODO: move to structure?
+	/*
+	 * reset global state
+	 * TODO: move to structure?
+	 */
 	paging_enabled = false;
 	chars_remaining = 0;
Index: uspace/app/trace/trace.c
===================================================================
--- uspace/app/trace/trace.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/app/trace/trace.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -53,5 +53,5 @@
 #include <libc.h>
 
-// Temporary: service and method names
+/* Temporary: service and method names */
 #include "proto.h"
 #include <ipc/services.h>
Index: uspace/drv/isa/isa.c
===================================================================
--- uspace/drv/isa/isa.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/drv/isa/isa.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -83,5 +83,5 @@
 static bool isa_enable_fun_interrupt(ddf_fun_t *fnode)
 {
-	// TODO
+	/* TODO */
 
 	return false;
Index: uspace/lib/c/arch/mips32/include/atomic.h
===================================================================
--- uspace/lib/c/arch/mips32/include/atomic.h	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/lib/c/arch/mips32/include/atomic.h	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -70,5 +70,4 @@
 		"	sc %0, %1\n"
 		"	beq %0, %4, 1b\n"	/* if the atomic operation failed, try again */
-		/*	nop	*/		/* nop is inserted automatically by compiler */
 		"	nop\n"
 		: "=&r" (tmp),
Index: uspace/lib/c/generic/adt/measured_strings.c
===================================================================
--- uspace/lib/c/generic/adt/measured_strings.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/lib/c/generic/adt/measured_strings.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -74,5 +74,5 @@
 	new->length = length;
 	new->value = ((uint8_t *) new) + sizeof(measured_string_t);
-	// append terminating zero explicitly - to be safe
+	/* Append terminating zero explicitly - to be safe */
 	memcpy(new->value, string, new->length);
 	new->value[new->length] = '\0';
Index: uspace/lib/c/generic/async.c
===================================================================
--- uspace/lib/c/generic/async.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/lib/c/generic/async.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -1586,12 +1586,14 @@
  * @param dst     Address of the beginning of the destination buffer.
  * @param size    Size of the destination buffer.
+ * @param flags   Flags to control the data transfer.
  *
  * @return Zero on success or a negative error code from errno.h.
  *
  */
-int async_data_read_start(int phoneid, void *dst, size_t size)
-{
-	return async_req_2_0(phoneid, IPC_M_DATA_READ, (sysarg_t) dst,
-	    (sysarg_t) size);
+int
+async_data_read_start_generic(int phoneid, void *dst, size_t size, int flags)
+{
+	return async_req_3_0(phoneid, IPC_M_DATA_READ, (sysarg_t) dst,
+	    (sysarg_t) size, (sysarg_t) flags);
 }
 
@@ -1683,12 +1685,15 @@
  * @param src     Address of the beginning of the source buffer.
  * @param size    Size of the source buffer.
+ * @param flags   Flags to control the data transfer.
  *
  * @return Zero on success or a negative error code from errno.h.
  *
  */
-int async_data_write_start(int phoneid, const void *src, size_t size)
-{
-	return async_req_2_0(phoneid, IPC_M_DATA_WRITE, (sysarg_t) src,
-	    (sysarg_t) size);
+int
+async_data_write_start_generic(int phoneid, const void *src, size_t size,
+    int flags)
+{
+	return async_req_3_0(phoneid, IPC_M_DATA_WRITE, (sysarg_t) src,
+	    (sysarg_t) size, (sysarg_t) flags);
 }
 
Index: uspace/lib/c/generic/vfs/vfs.c
===================================================================
--- uspace/lib/c/generic/vfs/vfs.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/lib/c/generic/vfs/vfs.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -378,5 +378,6 @@
 	
 	req = async_send_1(vfs_phone, VFS_IN_READ, fildes, &answer);
-	rc = async_data_read_start(vfs_phone, (void *)buf, nbyte);
+	rc = async_data_read_start_generic(vfs_phone, (void *) buf, nbyte,
+	    IPC_XF_RESTRICT);
 	if (rc != EOK) {
 		vfs_exchange_end(vfs_phone);
@@ -407,5 +408,6 @@
 	
 	req = async_send_1(vfs_phone, VFS_IN_WRITE, fildes, &answer);
-	rc = async_data_write_start(vfs_phone, (void *)buf, nbyte);
+	rc = async_data_write_start_generic(vfs_phone, (void *) buf, nbyte,
+	    IPC_XF_RESTRICT);
 	if (rc != EOK) {
 		vfs_exchange_end(vfs_phone);
Index: uspace/lib/c/include/async.h
===================================================================
--- uspace/lib/c/include/async.h	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/lib/c/include/async.h	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -341,5 +341,8 @@
 
 extern aid_t async_data_read(int, void *, size_t, ipc_call_t *);
-extern int async_data_read_start(int, void *, size_t);
+#define async_data_read_start(p, buf, len) \
+	async_data_read_start_generic((p), (buf), (len), IPC_XF_NONE)
+
+extern int async_data_read_start_generic(int, void *, size_t, int);
 extern bool async_data_read_receive(ipc_callid_t *, size_t *);
 extern int async_data_read_finalize(ipc_callid_t, const void *, size_t);
@@ -380,5 +383,8 @@
 	    (arg4), (answer))
 
-extern int async_data_write_start(int, const void *, size_t);
+#define async_data_write_start(p, buf, len) \
+	async_data_write_start_generic((p), (buf), (len), IPC_XF_NONE)
+
+extern int async_data_write_start_generic(int, const void *, size_t, int);
 extern bool async_data_write_receive(ipc_callid_t *, size_t *);
 extern int async_data_write_finalize(ipc_callid_t, void *, size_t);
Index: uspace/lib/drv/generic/driver.c
===================================================================
--- uspace/lib/drv/generic/driver.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/lib/drv/generic/driver.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -47,4 +47,5 @@
 #include <stdlib.h>
 #include <str.h>
+#include <str_error.h>
 #include <ctype.h>
 #include <errno.h>
@@ -402,5 +403,5 @@
 			    get_remote_method(rem_iface, iface_method_idx);
 			if (iface_method_ptr == NULL) {
-				// the interface has not such method
+				/* The interface has not such method */
 				printf("%s: driver_connection_gen error - "
 				    "invalid interface method.", driver->name);
@@ -655,4 +656,6 @@
 int ddf_driver_main(driver_t *drv)
 {
+	int rc;
+
 	/*
 	 * Remember the driver structure - driver_ops will be called by generic
@@ -668,9 +671,21 @@
 	
 	/*
-	 * Register driver by device manager with generic handler for incoming
-	 * connections.
+	 * Register driver with device manager using generic handler for
+	 * incoming connections.
 	 */
-	devman_driver_register(driver->name, driver_connection);
-	
+	rc = devman_driver_register(driver->name, driver_connection);
+	if (rc != EOK) {
+		printf("Error: Failed to register driver with device manager "
+		    "(%s).\n", (rc == EEXISTS) ? "driver already started" :
+		    str_error(rc));
+		
+		return 1;
+	}
+	
+	/* Return success from the task since server has started. */
+	rc = task_retval(0);
+	if (rc != EOK)
+		return 1;
+
 	async_manager();
 	
Index: uspace/lib/net/generic/generic.c
===================================================================
--- uspace/lib/net/generic/generic.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/lib/net/generic/generic.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -106,5 +106,5 @@
 		return EBADMEM;
 
-	// request the address
+	/* Request the address */
 	message_id = async_send_1(phone, (sysarg_t) message,
 	    (sysarg_t) device_id, NULL);
@@ -112,7 +112,7 @@
 	async_wait_for(message_id, &result);
 
-	// if not successful
+	/* If not successful */
 	if ((string == EOK) && (result != EOK)) {
-		// clear the data
+		/* Clear the data */
 		free(*address);
 		free(*data);
@@ -242,5 +242,5 @@
 		return EBADMEM;
 
-	// request the translation
+	/* Request the translation */
 	message_id = async_send_3(phone, (sysarg_t) message,
 	    (sysarg_t) device_id, (sysarg_t) count, (sysarg_t) service, NULL);
@@ -249,7 +249,7 @@
 	async_wait_for(message_id, &result);
 
-	// if not successful
+	/* If not successful */
 	if ((string == EOK) && (result != EOK)) {
-		// clear the data
+		/* Clear the data */
 		free(*translation);
 		free(*data);
Index: uspace/lib/net/generic/net_checksum.c
===================================================================
--- uspace/lib/net/generic/net_checksum.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/lib/net/generic/net_checksum.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -52,5 +52,5 @@
 uint16_t compact_checksum(uint32_t sum)
 {
-	// shorten to the 16 bits
+	/* Shorten to the 16 bits */
 	while (sum >> 16)
 		sum = (sum & 0xffff) + (sum >> 16);
@@ -72,9 +72,9 @@
 	size_t index;
 
-	// sum all the 16 bit fields
+	/* Sum all the 16 bit fields */
 	for (index = 0; index + 1 < length; index += 2)
 		seed += (data[index] << 8) + data[index + 1];
 
-	// last odd byte with zero padding
+	/* Last odd byte with zero padding */
 	if (index + 1 == length)
 		seed += data[index] << 8;
@@ -94,39 +94,39 @@
 	size_t index;
 
-	// process full bytes
+	/* Process full bytes */
 	while (length >= 8) {
-		// add the data
+		/* Add the data */
 		seed ^= (*data) << 24;
 		
-		// for each added bit
+		/* For each added bit */
 		for (index = 0; index < 8; ++index) {
-			// if the first bit is set
+			/* If the first bit is set */
 			if (seed & 0x80000000) {
-				// shift and divide the checksum
+				/* Shift and divide the checksum */
 				seed = (seed << 1) ^ ((uint32_t) CRC_DIVIDER_BE);
 			} else {
-				// shift otherwise
+				/* Shift otherwise */
 				seed <<= 1;
 			}
 		}
 		
-		// move to the next byte
+		/* Move to the next byte */
 		++data;
 		length -= 8;
 	}
 
-	// process the odd bits
+	/* Process the odd bits */
 	if (length > 0) {
-		// add the data with zero padding
+		/* Add the data with zero padding */
 		seed ^= ((*data) & (0xff << (8 - length))) << 24;
 		
-		// for each added bit
+		/* For each added bit */
 		for (index = 0; index < length; ++index) {
-			// if the first bit is set
+			/* If the first bit is set */
 			if (seed & 0x80000000) {
-				// shift and divide the checksum
+				/* Shift and divide the checksum */
 				seed = (seed << 1) ^ ((uint32_t) CRC_DIVIDER_BE);
 			} else {
-				// shift otherwise
+				/* Shift otherwise */
 				seed <<= 1;
 			}
@@ -148,38 +148,38 @@
 	size_t index;
 
-	// process full bytes
+	/* Process full bytes */
 	while (length >= 8) {
-		// add the data
+		/* Add the data */
 		seed ^= (*data);
 		
-		// for each added bit
+		/* For each added bit */
 		for (index = 0; index < 8; ++index) {
-			// if the last bit is set
+			/* If the last bit is set */
 			if (seed & 1) {
-				// shift and divide the checksum
+				/* Shift and divide the checksum */
 				seed = (seed >> 1) ^ ((uint32_t) CRC_DIVIDER_LE);
 			} else {
-				// shift otherwise
+				/* Shift otherwise */
 				seed >>= 1;
 			}
 		}
 		
-		// move to the next byte
+		/* Move to the next byte */
 		++data;
 		length -= 8;
 	}
 
-	// process the odd bits
+	/* Process the odd bits */
 	if (length > 0) {
-		// add the data with zero padding
+		/* Add the data with zero padding */
 		seed ^= (*data) >> (8 - length);
 		
 		for (index = 0; index < length; ++index) {
-			// if the last bit is set
+			/* If the last bit is set */
 			if (seed & 1) {
-				// shift and divide the checksum
+				/* Shift and divide the checksum */
 				seed = (seed >> 1) ^ ((uint32_t) CRC_DIVIDER_LE);
 			} else {
-				// shift otherwise
+				/* Shift otherwise */
 				seed >>= 1;
 			}
@@ -198,5 +198,5 @@
 uint16_t flip_checksum(uint16_t checksum)
 {
-	// flip, zero is returned as 0xFFFF (not flipped)
+	/* Flip, zero is returned as 0xFFFF (not flipped) */
 	checksum = ~checksum;
 	return checksum ? checksum : IP_CHECKSUM_ZERO;
@@ -216,5 +216,5 @@
 uint16_t ip_checksum(uint8_t *data, size_t length)
 {
-	// compute, compact and flip the data checksum
+	/* Compute, compact and flip the data checksum */
 	return flip_checksum(compact_checksum(compute_checksum(0, data,
 	    length)));
Index: uspace/lib/net/generic/packet_client.c
===================================================================
--- uspace/lib/net/generic/packet_client.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/lib/net/generic/packet_client.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -267,5 +267,5 @@
 		return NULL;
 
-	// get a new packet
+	/* Get a new packet */
 	copy = packet_get_4_remote(phone, PACKET_DATA_LENGTH(packet),
 	    PACKET_MAX_ADDRESS_LENGTH(packet), packet->max_prefix,
@@ -274,10 +274,10 @@
 		return NULL;
 
-	// get addresses
+	/* Get addresses */
 	addrlen = packet_get_addr(packet, &src, &dest);
-	// copy data
+	/* Copy data */
 	if ((packet_copy_data(copy, packet_get_data(packet),
 	    PACKET_DATA_LENGTH(packet)) == EOK) &&
-	    // copy addresses if present
+	    /* Copy addresses if present */
 	    ((addrlen <= 0) ||
 	    (packet_set_addr(copy, src, dest, addrlen) == EOK))) {
Index: uspace/lib/net/il/ip_client.c
===================================================================
--- uspace/lib/net/il/ip_client.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/lib/net/il/ip_client.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -124,5 +124,6 @@
 
 	// TODO IPv6
-/*	case AF_INET6:
+#if 0
+	case AF_INET6:
 		if (addrlen != sizeof(struct sockaddr_in6))
 			return EINVAL;
@@ -130,5 +131,5 @@
 		address_in6 = (struct sockaddr_in6 *) addr;
 		return EOK;
-*/
+#endif
 
 	default:
@@ -159,6 +160,8 @@
 	size_t padding;
 
-	// compute the padding if IP options are set
-	// multiple of 4 bytes
+	/*
+	 * Compute the padding if IP options are set
+	 * multiple of 4 bytes
+	 */
 	padding =  ipopt_length % 4;
 	if (padding) {
@@ -167,14 +170,14 @@
 	}
 
-	// prefix the header
+	/* Prefix the header */
 	data = (uint8_t *) packet_prefix(packet, sizeof(ip_header_t) + padding);
 	if (!data)
 		return ENOMEM;
 
-	// add the padding
+	/* Add the padding */
 	while (padding--)
 		data[sizeof(ip_header_t) + padding] = IPOPT_NOOP;
 
-	// set the header
+	/* Set the header */
 	header = (ip_header_t *) data;
 	header->header_length = IP_COMPUTE_HEADER_LENGTH(sizeof(ip_header_t) +
Index: uspace/lib/net/tl/icmp_client.c
===================================================================
--- uspace/lib/net/tl/icmp_client.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/lib/net/tl/icmp_client.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -81,5 +81,5 @@
 		*mtu = header->un.frag.mtu;
 
-	// remove debug dump
+	/* Remove debug dump */
 #ifdef CONFIG_DEBUG
 	printf("ICMP error %d (%d) in packet %d\n", header->type, header->code,
Index: uspace/lib/net/tl/socket_core.c
===================================================================
--- uspace/lib/net/tl/socket_core.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/lib/net/tl/socket_core.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -91,11 +91,11 @@
 	int packet_id;
 
-	// if bound
+	/* If bound */
 	if (socket->port) {
-		// release the port
+		/* Release the port */
 		socket_port_release(global_sockets, socket);
 	}
 	
-	// release all received packets
+	/* Release all received packets */
 	while ((packet_id = dyn_fifo_pop(&socket->received)) >= 0)
 		pq_release_remote(packet_phone, packet_id);
@@ -166,5 +166,5 @@
 	int rc;
 
-	// create a wrapper
+	/* Create a wrapper */
 	socket_ref = malloc(sizeof(*socket_ref));
 	if (!socket_ref)
@@ -172,5 +172,5 @@
 
 	*socket_ref = socket;
-	// add the wrapper
+	/* Add the wrapper */
 	rc = socket_port_map_add(&socket_port->map, key, key_length,
 	    socket_ref);
@@ -206,5 +206,5 @@
 	int rc;
 
-	// create a wrapper
+	/* Create a wrapper */
 	socket_port = malloc(sizeof(*socket_port));
 	if (!socket_port)
@@ -221,5 +221,5 @@
 		goto fail;
 	
-	// register the incomming port
+	/* Register the incoming port */
 	rc = socket_ports_add(global_sockets, port, socket_port);
 	if (rc < 0)
@@ -277,25 +277,25 @@
 		
 		address_in = (struct sockaddr_in *) addr;
-		// find the socket
+		/* Find the socket */
 		socket = socket_cores_find(local_sockets, socket_id);
 		if (!socket)
 			return ENOTSOCK;
 		
-		// bind a free port?
+		/* Bind a free port? */
 		if (address_in->sin_port <= 0)
 			return socket_bind_free_port(global_sockets, socket,
 			     free_ports_start, free_ports_end, last_used_port);
 		
-		// try to find the port
+		/* Try to find the port */
 		socket_port = socket_ports_find(global_sockets,
 		    ntohs(address_in->sin_port));
 		if (socket_port) {
-			// already used
+			/* Already used */
 			return EADDRINUSE;
 		}
 		
-		// if bound
+		/* If bound */
 		if (socket->port) {
-			// release the port
+			/* Release the port */
 			socket_port_release(global_sockets, socket);
 		}
@@ -333,5 +333,5 @@
 	int index;
 
-	// from the last used one
+	/* From the last used one */
 	index = last_used_port;
 	
@@ -339,18 +339,18 @@
 		++index;
 		
-		// til the range end
+		/* Till the range end */
 		if (index >= free_ports_end) {
-			// start from the range beginning
+			/* Start from the range beginning */
 			index = free_ports_start - 1;
 			do {
 				++index;
-				// til the last used one
+				/* Till the last used one */
 				if (index >= last_used_port) {
-					// none found
+					/* None found */
 					return ENOTCONN;
 				}
 			} while (socket_ports_find(global_sockets, index));
 			
-			// found, break immediately
+			/* Found, break immediately */
 			break;
 		}
@@ -376,5 +376,7 @@
 
 	count = 0;
-//	socket_id = socket_globals.last_id;
+#if 0
+	socket_id = socket_globals.last_id;
+#endif
 	do {
 		if (count < SOCKET_ID_TRIES) {
@@ -384,12 +386,14 @@
 			socket_id = 1;
 			++count;
-		// only this branch for last_id
+		/* Only this branch for last_id */
 		} else {
 			if (socket_id < INT_MAX) {
 				++ socket_id;
-/*			} else if(socket_globals.last_id) {
-*				socket_globals.last_id = 0;
-*				socket_id = 1;
-*/			} else {
+#if 0
+			} else if(socket_globals.last_id) {
+				socket_globals.last_id = 0;
+				socket_id = 1;
+#endif
+			} else {
 				return ELIMIT;
 			}
@@ -425,5 +429,5 @@
 		return EINVAL;
 	
-	// store the socket
+	/* Store the socket */
 	if (*socket_id <= 0) {
 		positive = (*socket_id == 0);
@@ -441,5 +445,5 @@
 		return ENOMEM;
 	
-	// initialize
+	/* Initialize */
 	socket->phone = app_phone;
 	socket->port = -1;
@@ -493,10 +497,10 @@
 	int accepted_id;
 
-	// find the socket
+	/* Find the socket */
 	socket = socket_cores_find(local_sockets, socket_id);
 	if (!socket)
 		return ENOTSOCK;
 	
-	// destroy all accepted sockets
+	/* Destroy all accepted sockets */
 	while ((accepted_id = dyn_fifo_pop(&socket->accepted)) >= 0)
 		socket_destroy(packet_phone, accepted_id, local_sockets,
@@ -535,13 +539,13 @@
 	next_packet = pq_next(packet);
 	if (!next_packet) {
-		// write all if only one fragment
+		/* Write all if only one fragment */
 		rc = data_reply(packet_get_data(packet),
 		    packet_get_data_length(packet));
 		if (rc != EOK)
 			return rc;
-		// store the total length
+		/* Store the total length */
 		*length = packet_get_data_length(packet);
 	} else {
-		// count the packet fragments
+		/* Count the packet fragments */
 		fragments = 1;
 		next_packet = pq_next(packet);
@@ -549,5 +553,5 @@
 			++fragments;
 		
-		// compute and store the fragment lengths
+		/* Compute and store the fragment lengths */
 		lengths = (size_t *) malloc(sizeof(size_t) * fragments +
 		    sizeof(size_t));
@@ -565,5 +569,5 @@
 		}
 		
-		// write the fragment lengths
+		/* Write the fragment lengths */
 		rc = data_reply(lengths, sizeof(int) * (fragments + 1));
 		if (rc != EOK) {
@@ -573,5 +577,5 @@
 		next_packet = packet;
 		
-		// write the fragments
+		/* Write the fragments */
 		for (index = 0; index < fragments; ++index) {
 			rc = data_reply(packet_get_data(next_packet),
@@ -584,5 +588,5 @@
 		}
 		
-		// store the total length
+		/* Store the total length */
 		*length = lengths[fragments];
 		free(lengths);
@@ -636,8 +640,8 @@
 		return;
 	
-	// find ports
+	/* Find ports */
 	socket_port = socket_ports_find(global_sockets, socket->port);
 	if (socket_port) {
-		// find the socket
+		/* Find the socket */
 		socket_ref = socket_port_map_find(&socket_port->map,
 		    socket->key, socket->key_length);
@@ -646,13 +650,13 @@
 			--socket_port->count;
 			
-			// release if empty
+			/* Release if empty */
 			if (socket_port->count <= 0) {
-				// destroy the map
+				/* Destroy the map */
 				socket_port_map_destroy(&socket_port->map, free);
-				// release the port
+				/* Release the port */
 				socket_ports_exclude(global_sockets,
 				    socket->port, free);
 			} else {
-				// remove
+				/* Remove */
 				socket_port_map_exclude(&socket_port->map,
 				    socket->key, socket->key_length, free);
@@ -685,10 +689,10 @@
 	int rc;
 
-	// find ports
+	/* Find ports */
 	socket_port = socket_ports_find(global_sockets, port);
 	if (!socket_port)
 		return ENOENT;
 	
-	// add the socket
+	/* Add the socket */
 	rc = socket_port_add_core(socket_port, socket, key, key_length);
 	if (rc != EOK)
Index: uspace/lib/net/tl/tl_common.c
===================================================================
--- uspace/lib/net/tl/tl_common.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/lib/net/tl/tl_common.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -255,5 +255,5 @@
 	int length;
 
-	// detach the first packet and release the others
+	/* Detach the first packet and release the others */
 	next = pq_detach(packet);
 	if (next)
@@ -262,6 +262,8 @@
 	length = packet_get_addr(packet, &src, NULL);
 	if ((length > 0) && (!error) && (icmp_phone >= 0) &&
-	    // set both addresses to the source one (avoids the source address
-	    // deletion before setting the destination one)
+	    /*
+	     * Set both addresses to the source one (avoids the source address
+	     * deletion before setting the destination one)
+	     */
 	    (packet_set_addr(packet, src, src, (size_t) length) == EOK)) {
 		return EOK;
@@ -299,9 +301,9 @@
 		return EINVAL;
 
-	// get the data length
+	/* Get the data length */
 	if (!async_data_write_receive(&callid, &length))
 		return EINVAL;
 
-	// get a new packet
+	/* Get a new packet */
 	*packet = packet_get_4_remote(packet_phone, length, dimension->addr_len,
 	    prefix + dimension->prefix, dimension->suffix);
@@ -309,5 +311,5 @@
 		return ENOMEM;
 
-	// allocate space in the packet
+	/* Allocate space in the packet */
 	data = packet_suffix(*packet, length);
 	if (!data) {
@@ -316,5 +318,5 @@
 	}
 
-	// read the data into the packet
+	/* Read the data into the packet */
 	rc = async_data_write_finalize(callid, data, length);
 	if (rc != EOK) {
@@ -323,5 +325,5 @@
 	}
 	
-	// set the packet destination address
+	/* Set the packet destination address */
 	rc = packet_set_addr(*packet, NULL, (uint8_t *) addr, addrlen);
 	if (rc != EOK) {
Index: uspace/lib/packet/generic/packet_server.c
===================================================================
--- uspace/lib/packet/generic/packet_server.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/lib/packet/generic/packet_server.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -112,9 +112,9 @@
     size_t max_content, size_t max_suffix)
 {
-	// clear the packet content
+	/* Clear the packet content */
 	bzero(((void *) packet) + sizeof(packet_t),
 	    packet->length - sizeof(packet_t));
 	
-	// clear the packet header
+	/* Clear the packet header */
 	packet->order = 0;
 	packet->metric = 0;
@@ -151,5 +151,5 @@
 	assert(fibril_mutex_is_locked(&ps_globals.lock));
 
-	// already locked
+	/* Already locked */
 	packet = (packet_t *) mmap(NULL, length, PROTO_READ | PROTO_WRITE,
 	    MAP_SHARED | MAP_ANONYMOUS, 0, 0);
Index: uspace/lib/softint/generic/multiplication.c
===================================================================
--- uspace/lib/softint/generic/multiplication.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/lib/softint/generic/multiplication.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -109,5 +109,5 @@
 	 * result does not fit in signed one */
 	if (SOFTINT_CHECK_OF && ((t2 < t1) || (t2 & (1ull << 63)))) {
-		// error, overflow
+		/* Error, overflow */
 		return (neg ? INT64_MIN : INT64_MAX);
 	}
Index: uspace/srv/bd/ata_bd/ata_bd.c
===================================================================
--- uspace/srv/bd/ata_bd/ata_bd.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/srv/bd/ata_bd/ata_bd.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -372,4 +372,5 @@
 	uint16_t w;
 	uint8_t c;
+	uint16_t bc;
 	size_t pos, len;
 	int rc;
@@ -387,11 +388,24 @@
 	} else if (rc == EIO) {
 		/*
-		 * There is something, but not a register device.
-		 * It could be a packet device.
+		 * There is something, but not a register device. Check to see
+		 * whether the IDENTIFY command left the packet signature in
+		 * the registers in case this is a packet device.
+		 *
+		 * According to the ATA specification, the LBA low and
+		 * interrupt reason registers should be set to 0x01. However,
+		 * there are many devices that do not follow this and only set
+		 * the byte count registers. So, only check these.
 		 */
-		rc = identify_pkt_dev(disk_id, &idata);
-		if (rc == EOK) {
-			/* We have a packet device. */
-			d->dev_type = ata_pkt_dev;
+		bc = ((uint16_t)pio_read_8(&cmd->cylinder_high) << 8) |
+		    pio_read_8(&cmd->cylinder_low);
+
+		if (bc == PDEV_SIGNATURE_BC) {
+			rc = identify_pkt_dev(disk_id, &idata);
+			if (rc == EOK) {
+				/* We have a packet device. */
+				d->dev_type = ata_pkt_dev;
+			} else {
+				return EIO;
+			}
 		} else {
 			/* Nope. Something's there, but not recognized. */
@@ -403,5 +417,4 @@
 	}
 
-	printf("device caps: 0x%04x\n", idata.caps);
 	if (d->dev_type == ata_pkt_dev) {
 		/* Packet device */
@@ -566,8 +579,9 @@
 
 	/*
-	 * This is where we would most likely expect a non-existing device to
-	 * show up by not setting SR_DRDY.
+	 * Do not wait for DRDY to be set in case this is a packet device.
+	 * We determine whether the device is present by waiting for DRQ to be
+	 * set after issuing the command.
 	 */
-	if (wait_status(SR_DRDY, ~SR_BSY, NULL, TIMEOUT_PROBE) != EOK)
+	if (wait_status(0, ~SR_BSY, NULL, TIMEOUT_PROBE) != EOK)
 		return ETIMEOUT;
 
@@ -577,15 +591,20 @@
 		return ETIMEOUT;
 
+	/*
+	 * If ERR is set, this may be a packet device, so return EIO to cause
+	 * the caller to check for one.
+	 */
+	if ((status & SR_ERR) != 0) {
+		return EIO;
+	}
+
+	if (wait_status(SR_DRQ, ~SR_BSY, &status, TIMEOUT_PROBE) != EOK)
+		return ETIMEOUT;
+
 	/* Read data from the disk buffer. */
 
-	if ((status & SR_DRQ) != 0) {
-		for (i = 0; i < identify_data_size / 2; i++) {
-			data = pio_read_16(&cmd->data_port);
-			((uint16_t *) buf)[i] = data;
-		}
-	}
-
-	if ((status & SR_ERR) != 0) {
-		return EIO;
+	for (i = 0; i < identify_data_size / 2; i++) {
+		data = pio_read_16(&cmd->data_port);
+		((uint16_t *) buf)[i] = data;
 	}
 
Index: uspace/srv/bd/ata_bd/ata_hw.h
===================================================================
--- uspace/srv/bd/ata_bd/ata_hw.h	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/srv/bd/ata_bd/ata_hw.h	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -293,4 +293,12 @@
 };
 
+enum ata_pdev_signature {
+	/**
+	 * Signature put by a packet device in byte count register
+	 * in response to Identify command.
+	 */
+	PDEV_SIGNATURE_BC	= 0xEB14
+};
+
 #endif
 
Index: uspace/srv/devman/devman.c
===================================================================
--- uspace/srv/devman/devman.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/srv/devman/devman.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -555,17 +555,4 @@
 }
 
-/** Remember the driver's phone.
- *
- * @param driver	The driver.
- * @param phone		The phone to the driver.
- */
-void set_driver_phone(driver_t *driver, sysarg_t phone)
-{
-	fibril_mutex_lock(&driver->driver_mutex);
-	assert(driver->state == DRIVER_STARTING);
-	driver->phone = phone;
-	fibril_mutex_unlock(&driver->driver_mutex);
-}
-
 /** Notify driver about the devices to which it was assigned.
  *
@@ -685,4 +672,5 @@
 	list_initialize(&drv->devices);
 	fibril_mutex_initialize(&drv->driver_mutex);
+	drv->phone = -1;
 }
 
Index: uspace/srv/devman/devman.h
===================================================================
--- uspace/srv/devman/devman.h	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/srv/devman/devman.h	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -88,5 +88,5 @@
 	
 	/** Phone asociated with this driver. */
-	sysarg_t phone;
+	int phone;
 	/** Name of the device driver. */
 	char *name;
@@ -316,5 +316,4 @@
 
 extern driver_t *find_driver(driver_list_t *, const char *);
-extern void set_driver_phone(driver_t *, sysarg_t);
 extern void initialize_running_driver(driver_t *, dev_tree_t *);
 
Index: uspace/srv/devman/main.c
===================================================================
--- uspace/srv/devman/main.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/srv/devman/main.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -95,5 +95,4 @@
 	/* Find driver structure. */
 	driver = find_driver(&drivers_list, drv_name);
-	
 	if (driver == NULL) {
 		log_msg(LVL_ERROR, "No driver named `%s' was found.", drv_name);
@@ -107,4 +106,30 @@
 	drv_name = NULL;
 	
+	fibril_mutex_lock(&driver->driver_mutex);
+	
+	if (driver->phone >= 0) {
+		/* We already have a connection to the driver. */
+		log_msg(LVL_ERROR, "Driver '%s' already started.\n",
+		    driver->name);
+		fibril_mutex_unlock(&driver->driver_mutex);
+		async_answer_0(iid, EEXISTS);
+		return NULL;
+	}
+	
+	switch (driver->state) {
+	case DRIVER_NOT_STARTED:
+		/* Somebody started the driver manually. */
+		log_msg(LVL_NOTE, "Driver '%s' started manually.\n",
+		    driver->name);
+		driver->state = DRIVER_STARTING;
+		break;
+	case DRIVER_STARTING:
+		/* The expected case */
+		break;
+	case DRIVER_RUNNING:
+		/* Should not happen since we do not have a connected phone */
+		assert(false);
+	}
+	
 	/* Create connection to the driver. */
 	log_msg(LVL_DEBUG, "Creating connection to the `%s' driver.",
@@ -113,4 +138,5 @@
 	ipc_callid_t callid = async_get_call(&call);
 	if (IPC_GET_IMETHOD(call) != IPC_M_CONNECT_TO_ME) {
+		fibril_mutex_unlock(&driver->driver_mutex);
 		async_answer_0(callid, ENOTSUP);
 		async_answer_0(iid, ENOTSUP);
@@ -119,5 +145,7 @@
 	
 	/* Remember driver's phone. */
-	set_driver_phone(driver, IPC_GET_ARG5(call));
+	driver->phone = IPC_GET_ARG5(call);
+	
+	fibril_mutex_unlock(&driver->driver_mutex);
 	
 	log_msg(LVL_NOTE, 
@@ -579,5 +607,5 @@
 		method = DRIVER_CLIENT;
 	
-	if (driver->phone <= 0) {
+	if (driver->phone < 0) {
 		log_msg(LVL_ERROR, 
 		    "Could not forward to driver `%s' (phone is %d).",
@@ -619,5 +647,5 @@
 	dev = fun->dev;
 	
-	if (dev->state != DEVICE_USABLE || dev->drv->phone <= 0) {
+	if (dev->state != DEVICE_USABLE || dev->drv->phone < 0) {
 		async_answer_0(iid, EINVAL);
 		return;
Index: uspace/srv/fs/fat/fat_ops.c
===================================================================
--- uspace/srv/fs/fat/fat_ops.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/srv/fs/fat/fat_ops.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -722,6 +722,6 @@
 		    (str_cmp((char *) d->name, FAT_NAME_DOT)) == 0) {
 			memset(d, 0, sizeof(fat_dentry_t));
-			str_cpy((char *) d->name, 8, FAT_NAME_DOT);
-			str_cpy((char *) d->ext, 3, FAT_EXT_PAD);
+			memcpy(d->name, FAT_NAME_DOT, FAT_NAME_LEN);
+			memcpy(d->ext, FAT_EXT_PAD, FAT_EXT_LEN);
 			d->attr = FAT_ATTR_SUBDIR;
 			d->firstc = host2uint16_t_le(childp->firstc);
@@ -732,6 +732,6 @@
 		    (str_cmp((char *) d->name, FAT_NAME_DOT_DOT) == 0)) {
 			memset(d, 0, sizeof(fat_dentry_t));
-			str_cpy((char *) d->name, 8, FAT_NAME_DOT_DOT);
-			str_cpy((char *) d->ext, 3, FAT_EXT_PAD);
+			memcpy(d->name, FAT_NAME_DOT_DOT, FAT_NAME_LEN);
+			memcpy(d->ext, FAT_EXT_PAD, FAT_EXT_LEN);
 			d->attr = FAT_ATTR_SUBDIR;
 			d->firstc = (parentp->firstc == FAT_CLST_ROOT) ?
Index: uspace/srv/net/il/ip/ip.c
===================================================================
--- uspace/srv/net/il/ip/ip.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/srv/net/il/ip/ip.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -176,5 +176,5 @@
 	socklen_t addrlen;
 
-	// detach the first packet and release the others
+	/* Detach the first packet and release the others */
 	next = pq_detach(packet);
 	if (next)
@@ -185,5 +185,5 @@
 			return ENOMEM;
 
-		// get header
+		/* Get header */
 		header = (ip_header_t *) packet_get_data(packet);
 		if (!header)
@@ -192,13 +192,13 @@
 	}
 
-	// only for the first fragment
+	/* Only for the first fragment */
 	if (IP_FRAGMENT_OFFSET(header))
 		return EINVAL;
 
-	// not for the ICMP protocol
+	/* Not for the ICMP protocol */
 	if (header->protocol == IPPROTO_ICMP)
 		return EPERM;
 
-	// set the destination address
+	/* Set the destination address */
 	switch (header->version) {
 	case IPVERSION:
@@ -351,5 +351,5 @@
 	configuration = &names[0];
 
-	// get configuration
+	/* Get configuration */
 	rc = net_get_device_conf_req(ip_globals.net_phone, ip_netif->device_id,
 	    &configuration, count, &data);
@@ -419,5 +419,5 @@
 	}
 
-	// binds the netif service which also initializes the device
+	/* Bind netif service which also initializes the device */
 	ip_netif->phone = nil_bind_service(ip_netif->service,
 	    (sysarg_t) ip_netif->device_id, SERVICE_IP,
@@ -429,5 +429,5 @@
 	}
 
-	// has to be after the device netif module initialization
+	/* Has to be after the device netif module initialization */
 	if (ip_netif->arp) {
 		if (route) {
@@ -445,5 +445,5 @@
 	}
 
-	// get packet dimensions
+	/* Get packet dimensions */
 	rc = nil_packet_size_req(ip_netif->phone, ip_netif->device_id,
 	    &ip_netif->packet_dimension);
@@ -463,5 +463,5 @@
 	
 	if (gateway.s_addr) {
-		// the default gateway
+		/* The default gateway */
 		ip_globals.gateway.address.s_addr = 0;
 		ip_globals.gateway.netmask.s_addr = 0;
@@ -512,5 +512,5 @@
 		ip_netif->arp->usage++;
 
-	// print the settings
+	/* Print the settings */
 	printf("%s: Device registered (id: %d, phone: %d, ipv: %d, conf: %s)\n",
 	    NAME, ip_netif->device_id, ip_netif->phone, ip_netif->ipv,
@@ -587,5 +587,5 @@
 	ip_netif_t *netif;
 
-	// start with the last netif - the newest one
+	/* Start with the last netif - the newest one */
 	index = ip_netifs_count(&ip_globals.netifs) - 1;
 	while (index >= 0) {
@@ -629,18 +629,18 @@
 	size_t length;
 
-	// copy first itself
+	/* Copy first itself */
 	memcpy(last, first, sizeof(ip_header_t));
 	length = sizeof(ip_header_t);
 	next = sizeof(ip_header_t);
 
-	// process all ip options
+	/* Process all IP options */
 	while (next < first->header_length) {
 		option = (ip_option_t *) (((uint8_t *) first) + next);
-		// skip end or noop
+		/* Skip end or noop */
 		if ((option->type == IPOPT_END) ||
 		    (option->type == IPOPT_NOOP)) {
 			next++;
 		} else {
-			// copy if told so or skip
+			/* Copy if told so or skip */
 			if (IPOPT_COPIED(option->type)) {
 				memcpy(((uint8_t *) last) + length,
@@ -648,10 +648,10 @@
 				length += option->length;
 			}
-			// next option
+			/* Next option */
 			next += option->length;
 		}
 	}
 
-	// align 4 byte boundary
+	/* Align 4 byte boundary */
 	if (length % 4) {
 		bzero(((uint8_t *) last) + length, 4 - (length % 4));
@@ -789,5 +789,5 @@
 
 	header->total_length = htons(length);
-	// unnecessary for all protocols
+	/* Unnecessary for all protocols */
 	header->header_checksum = IP_HEADER_CHECKSUM(header);
 
@@ -916,14 +916,14 @@
 		return ENOMEM;
 
-	// get header
+	/* Get header */
 	header = (ip_header_t *) packet_get_data(packet);
 	if (!header)
 		return EINVAL;
 
-	// fragmentation forbidden?
+	/* Fragmentation forbidden? */
 	if(header->flags & IPFLAG_DONT_FRAGMENT)
 		return EPERM;
 
-	// create the last fragment
+	/* Create the last fragment */
 	new_packet = packet_get_4_remote(ip_globals.net_phone, prefix, length,
 	    suffix, ((addrlen > addr_len) ? addrlen : addr_len));
@@ -931,5 +931,5 @@
 		return ENOMEM;
 
-	// allocate as much as originally
+	/* Allocate as much as originally */
 	last_header = (ip_header_t *) packet_suffix(new_packet,
 	    IP_HEADER_LENGTH(header));
@@ -939,5 +939,5 @@
 	ip_create_last_header(last_header, header);
 
-	// trim the unused space
+	/* Trim the unused space */
 	rc = packet_trim(new_packet, 0,
 	    IP_HEADER_LENGTH(header) - IP_HEADER_LENGTH(last_header));
@@ -945,5 +945,5 @@
 		return ip_release_and_return(packet, rc);
 
-	// biggest multiple of 8 lower than content
+	/* Greatest multiple of 8 lower than content */
 	// TODO even fragmentation?
 	length = length & ~0x7;
@@ -957,8 +957,8 @@
 		return ip_release_and_return(packet, rc);
 
-	// mark the first as fragmented
+	/* Mark the first as fragmented */
 	header->flags |= IPFLAG_MORE_FRAGMENTS;
 
-	// create middle framgents
+	/* Create middle fragments */
 	while (IP_TOTAL_LENGTH(header) > length) {
 		new_packet = packet_get_4_remote(ip_globals.net_phone, prefix,
@@ -981,5 +981,5 @@
 	}
 
-	// finish the first fragment
+	/* Finish the first fragment */
 	header->header_checksum = IP_HEADER_CHECKSUM(header);
 
@@ -1012,5 +1012,5 @@
 
 	next = packet;
-	// check all packets
+	/* Check all packets */
 	while (next) {
 		length = packet_get_data_length(next);
@@ -1021,5 +1021,5 @@
 		}
 
-		// too long
+		/* Too long */
 		result = ip_fragment_packet(next, content, prefix,
 		    suffix, addr_len);
@@ -1027,13 +1027,13 @@
 			new_packet = pq_detach(next);
 			if (next == packet) {
-				// the new first packet of the queue
+				/* The new first packet of the queue */
 				packet = new_packet;
 			}
-			// fragmentation needed?
+			/* Fragmentation needed? */
 			if (result == EPERM) {
 				phone = ip_prepare_icmp_and_get_phone(
 				    error, next, NULL);
 				if (phone >= 0) {
-					// fragmentation necessary ICMP
+					/* Fragmentation necessary ICMP */
 					icmp_destination_unreachable_msg(phone,
 					    ICMP_FRAG_NEEDED, content, next);
@@ -1080,5 +1080,5 @@
 	int rc;
 
-	// get destination hardware address
+	/* Get destination hardware address */
 	if (netif->arp && (route->address.s_addr != dest.s_addr)) {
 		destination.value = route->gateway.s_addr ?
@@ -1102,5 +1102,5 @@
 			    NULL);
 			if (phone >= 0) {
-				// unreachable ICMP if no routing
+				/* Unreachable ICMP if no routing */
 				icmp_destination_unreachable_msg(phone,
 				    ICMP_HOST_UNREACH, 0, packet);
@@ -1148,6 +1148,8 @@
 	int rc;
 
-	// addresses in the host byte order
-	// should be the next hop address or the target destination address
+	/*
+	 * Addresses in the host byte order
+	 * Should be the next hop address or the target destination address
+	 */
 	addrlen = packet_get_addr(packet, NULL, (uint8_t **) &addr);
 	if (addrlen < 0)
@@ -1174,5 +1176,5 @@
 	fibril_rwlock_read_lock(&ip_globals.netifs_lock);
 
-	// device specified?
+	/* Device specified? */
 	if (device_id > 0) {
 		netif = ip_netifs_find(&ip_globals.netifs, device_id);
@@ -1190,5 +1192,5 @@
 		phone = ip_prepare_icmp_and_get_phone(error, packet, NULL);
 		if (phone >= 0) {
-			// unreachable ICMP if no routing
+			/* Unreachable ICMP if no routing */
 			icmp_destination_unreachable_msg(phone,
 			    ICMP_NET_UNREACH, 0, packet);
@@ -1198,6 +1200,8 @@
 
 	if (error) {
-		// do not send for broadcast, anycast packets or network
-		// broadcast
+		/*
+		 * Do not send for broadcast, anycast packets or network
+		 * broadcast.
+		 */
 		if (!dest->s_addr || !(~dest->s_addr) ||
 		    !(~((dest->s_addr & ~route->netmask.s_addr) |
@@ -1208,8 +1212,8 @@
 	}
 	
-	// if the local host is the destination
+	/* If the local host is the destination */
 	if ((route->address.s_addr == dest->s_addr) &&
 	    (dest->s_addr != IPV4_LOCALHOST_ADDRESS)) {
-		// find the loopback device to deliver
+		/* Find the loopback device to deliver */
 		dest->s_addr = IPV4_LOCALHOST_ADDRESS;
 		route = ip_find_route(*dest);
@@ -1220,5 +1224,5 @@
 			    NULL);
 			if (phone >= 0) {
-				// unreachable ICMP if no routing
+				/* Unreachable ICMP if no routing */
 				icmp_destination_unreachable_msg(phone,
 				    ICMP_HOST_UNREACH, 0, packet);
@@ -1252,5 +1256,5 @@
 
 	fibril_rwlock_write_lock(&ip_globals.netifs_lock);
-	// find the device
+	/* Find the device */
 	netif = ip_netifs_find(&ip_globals.netifs, device_id);
 	if (!netif) {
@@ -1344,5 +1348,5 @@
 		return ip_release_and_return(packet, rc);
 
-	// trim padding if present
+	/* Trim padding if present */
 	if (!error &&
 	    (IP_TOTAL_LENGTH(header) < packet_get_data_length(packet))) {
@@ -1360,5 +1364,5 @@
 		phone = ip_prepare_icmp_and_get_phone(error, packet, header);
 		if (phone >= 0) {
-			// unreachable ICMP
+			/* Unreachable ICMP */
 			icmp_destination_unreachable_msg(phone,
 			    ICMP_PROT_UNREACH, 0, packet);
@@ -1417,10 +1421,10 @@
 		return ip_release_and_return(packet, ENOMEM);
 
-	// checksum
+	/* Checksum */
 	if ((header->header_checksum) &&
 	    (IP_HEADER_CHECKSUM(header) != IP_CHECKSUM_ZERO)) {
 		phone = ip_prepare_icmp_and_get_phone(0, packet, header);
 		if (phone >= 0) {
-			// checksum error ICMP
+			/* Checksum error ICMP */
 			icmp_parameter_problem_msg(phone, ICMP_PARAM_POINTER,
 			    ((size_t) ((void *) &header->header_checksum)) -
@@ -1433,5 +1437,5 @@
 		phone = ip_prepare_icmp_and_get_phone(0, packet, header);
 		if (phone >= 0) {
-			// ttl exceeded ICMP
+			/* TTL exceeded ICMP */
 			icmp_time_exceeded_msg(phone, ICMP_EXC_TTL, packet);
 		}
@@ -1439,8 +1443,8 @@
 	}
 	
-	// process ipopt and get destination
+	/* Process ipopt and get destination */
 	dest = ip_get_destination(header);
 
-	// set the addrination address
+	/* Set the destination address */
 	switch (header->version) {
 	case IPVERSION:
@@ -1464,5 +1468,5 @@
 		phone = ip_prepare_icmp_and_get_phone(0, packet, header);
 		if (phone >= 0) {
-			// unreachable ICMP
+			/* Unreachable ICMP */
 			icmp_destination_unreachable_msg(phone,
 			    ICMP_HOST_UNREACH, 0, packet);
@@ -1472,5 +1476,5 @@
 
 	if (route->address.s_addr == dest.s_addr) {
-		// local delivery
+		/* Local delivery */
 		return ip_deliver_local(device_id, packet, header, 0);
 	}
@@ -1484,5 +1488,5 @@
 	phone = ip_prepare_icmp_and_get_phone(0, packet, header);
 	if (phone >= 0) {
-		// unreachable ICMP if no routing
+		/* Unreachable ICMP if no routing */
 		icmp_destination_unreachable_msg(phone, ICMP_HOST_UNREACH, 0,
 		    packet);
@@ -1770,8 +1774,8 @@
 		header = (ip_header_t *)(data + offset);
 
-		// destination host unreachable?
+		/* Destination host unreachable? */
 		if ((type != ICMP_DEST_UNREACH) ||
 		    (code != ICMP_HOST_UNREACH)) {
-		    	// no, something else
+			/* No, something else */
 			break;
 		}
@@ -1787,8 +1791,8 @@
 		route = ip_routes_get_index(&netif->routes, 0);
 
-		// from the same network?
+		/* From the same network? */
 		if (route && ((route->address.s_addr & route->netmask.s_addr) ==
 		    (header->destination_address & route->netmask.s_addr))) {
-			// clear the ARP mapping if any
+			/* Clear the ARP mapping if any */
 			address.value = (uint8_t *) &header->destination_address;
 			address.length = sizeof(header->destination_address);
@@ -1844,8 +1848,8 @@
 	fibril_rwlock_read_lock(&ip_globals.lock);
 	route = ip_find_route(*dest);
-	// if the local host is the destination
+	/* If the local host is the destination */
 	if (route && (route->address.s_addr == dest->s_addr) &&
 	    (dest->s_addr != IPV4_LOCALHOST_ADDRESS)) {
-		// find the loopback device to deliver
+		/* Find the loopback device to deliver */
 		dest->s_addr = IPV4_LOCALHOST_ADDRESS;
 		route = ip_find_route(*dest);
Index: uspace/srv/net/nil/eth/eth.c
===================================================================
--- uspace/srv/net/nil/eth/eth.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/srv/net/nil/eth/eth.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -531,5 +531,5 @@
 			    proto->service);
 		} else {
-			// drop invalid/unknown
+			/* Drop invalid/unknown */
 			pq_release_remote(eth_globals.net_phone,
 			    packet_get_id(packet));
Index: uspace/srv/net/tl/tcp/tcp.c
===================================================================
--- uspace/srv/net/tl/tcp/tcp.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/srv/net/tl/tcp/tcp.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -299,7 +299,8 @@
 		return tcp_release_and_return(packet, NO_DATA);
 
-//      printf("header len %d, port %d \n", TCP_HEADER_LENGTH(header),
-//	    ntohs(header->destination_port));
-
+#if 0
+	printf("header len %d, port %d \n", TCP_HEADER_LENGTH(header),
+	    ntohs(header->destination_port));
+#endif
 	result = packet_get_addr(packet, (uint8_t **) &src, (uint8_t **) &dest);
 	if (result <= 0)
@@ -1062,5 +1063,5 @@
 	tcp_process_acknowledgement(socket, socket_data, header);
 
-	socket_data->next_incoming = ntohl(header->sequence_number);	// + 1;
+	socket_data->next_incoming = ntohl(header->sequence_number); /* + 1; */
 	pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
 	socket_data->state = TCP_SOCKET_ESTABLISHED;
Index: uspace/srv/net/tl/tcp/tcp.h
===================================================================
--- uspace/srv/net/tl/tcp/tcp.h	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/srv/net/tl/tcp/tcp.h	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -190,7 +190,4 @@
 	int backlog;
 	
-//	/** Segment size. */
-//	size_t segment_size;
-
 	/**
 	 * Parent listening socket identifier.
Index: uspace/srv/net/tl/udp/udp.c
===================================================================
--- uspace/srv/net/tl/udp/udp.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/srv/net/tl/udp/udp.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -499,5 +499,9 @@
 	device_id_t device_id;
 	packet_dimension_t *packet_dimension;
+	size_t size;
 	int rc;
+
+	/* In case of error, do not update the data fragment size. */
+	*data_fragment_size = 0;
 	
 	rc = tl_get_address_port(addr, addrlen, &dest_port);
@@ -539,4 +543,14 @@
 		packet_dimension = &udp_globals.packet_dimension;
 //	}
+
+	/*
+	 * Update the data fragment size based on what the lower layers can
+	 * handle without fragmentation, but not more than the maximum allowed
+	 * for UDP.
+	 */
+	size = MAX_UDP_FRAGMENT_SIZE;
+	if (packet_dimension->content < size)
+	    size = packet_dimension->content;
+	*data_fragment_size = size;
 
 	/* Read the first packet fragment */
@@ -740,5 +754,5 @@
 	int socket_id;
 	size_t addrlen;
-	size_t size = 0;
+	size_t size;
 	ipc_call_t answer;
 	size_t answer_count;
@@ -786,13 +800,12 @@
 				break;
 			
+			size = MAX_UDP_FRAGMENT_SIZE;
 			if (tl_get_ip_packet_dimension(udp_globals.ip_phone,
 			    &udp_globals.dimensions, DEVICE_INVALID_ID,
 			    &packet_dimension) == EOK) {
-				SOCKET_SET_DATA_FRAGMENT_SIZE(answer,
-				    packet_dimension->content);
+				if (packet_dimension->content < size)
+					size = packet_dimension->content;
 			}
-
-//			SOCKET_SET_DATA_FRAGMENT_SIZE(answer,
-//			    MAX_UDP_FRAGMENT_SIZE);
+			SOCKET_SET_DATA_FRAGMENT_SIZE(answer, size);
 			SOCKET_SET_HEADER_SIZE(answer, UDP_HEADER_SIZE);
 			answer_count = 3;
Index: uspace/srv/vfs/vfs_file.c
===================================================================
--- uspace/srv/vfs/vfs_file.c	(revision 8b4ce802edc5d9f2773a6854f6af04b33f3c6337)
+++ uspace/srv/vfs/vfs_file.c	(revision b77ce846fff6014d76b815421e18b3d5a97d502d)
@@ -258,7 +258,9 @@
 	if ((fd >= 0) && (fd < MAX_OPEN_FILES)) {
 		vfs_file_t *file = FILES[fd];
-		vfs_file_addref(file);
-		fibril_mutex_unlock(&VFS_DATA->lock);
-		return file;
+		if (file != NULL) {
+			vfs_file_addref(file);
+			fibril_mutex_unlock(&VFS_DATA->lock);
+			return file;
+		}
 	}
 	fibril_mutex_unlock(&VFS_DATA->lock);
