Index: uspace/srv/vfs/vfs_lookup.c
===================================================================
--- uspace/srv/vfs/vfs_lookup.c	(revision 7f59d6c9f9a3c91ae568af7f47309431be5b58ab)
+++ uspace/srv/vfs/vfs_lookup.c	(revision 4f9ab1e931ca73f16a2e46e300122113719d1c1f)
@@ -314,8 +314,14 @@
 		if (nlen > 0) {
 			base = vfs_node_peek(&res);
-			if (base == NULL || base->mount == NULL) {
+			if (!base) {
 				rc = ENOENT;
 				goto out;
 			}
+	       		if (!base->mount) {
+				vfs_node_put(base);
+				rc = ENOENT;
+				goto out;
+			}
+			vfs_node_put(base);
 			if (lflag & L_DISABLE_MOUNTS) {
 				rc = EXDEV;
@@ -330,16 +336,22 @@
 	if (result != NULL) {
 		/* The found file may be a mount point. Try to cross it. */
-		if (!(lflag & (L_MP|L_DISABLE_MOUNTS))) {
+		if (!(lflag & (L_MP | L_DISABLE_MOUNTS))) {
 			base = vfs_node_peek(&res);
-			if (base != NULL && base->mount != NULL) {
-				while (base->mount != NULL) {
-					base = base->mount;
+			if (base && base->mount) {
+				while (base->mount) {
+					vfs_node_addref(base->mount);
+					vfs_node_t *nbase = base->mount;
+					vfs_node_put(base);
+					base = nbase;
 				}
 				
-				result->triplet = *(vfs_triplet_t *)base;
+				result->triplet = *((vfs_triplet_t *) base);
 				result->type = base->type;
-				result->size = base->size;				
-				goto out;
-			}
+				result->size = base->size;
+				vfs_node_put(base);
+				goto out;
+			}
+			if (base)
+				vfs_node_put(base);
 		}
 
Index: uspace/srv/vfs/vfs_node.c
===================================================================
--- uspace/srv/vfs/vfs_node.c	(revision 7f59d6c9f9a3c91ae568af7f47309431be5b58ab)
+++ uspace/srv/vfs/vfs_node.c	(revision 4f9ab1e931ca73f16a2e46e300122113719d1c1f)
@@ -204,4 +204,5 @@
 	if (tmp) {
 		node = hash_table_get_inst(tmp, vfs_node_t, nh_link);
+		_vfs_node_addref(node);
 	}
 	fibril_mutex_unlock(&nodes_mutex);
Index: uspace/srv/vfs/vfs_ops.c
===================================================================
--- uspace/srv/vfs/vfs_ops.c	(revision 7f59d6c9f9a3c91ae568af7f47309431be5b58ab)
+++ uspace/srv/vfs/vfs_ops.c	(revision 4f9ab1e931ca73f16a2e46e300122113719d1c1f)
@@ -618,6 +618,10 @@
 	
 	/* If the node is not held by anyone, try to destroy it. */
-	if (orig_unlinked && vfs_node_peek(&new_lr_orig) == NULL) {
-		out_destroy(&new_lr_orig.triplet);
+	if (orig_unlinked) {
+		vfs_node_t *node = vfs_node_peek(&new_lr_orig);
+		if (!node)
+			out_destroy(&new_lr_orig.triplet);
+		else
+			vfs_node_put(node);
 	}
 	
@@ -824,5 +828,6 @@
 		}
 		
-		vfs_node_t *found_node = vfs_node_peek(&lr);		
+		vfs_node_t *found_node = vfs_node_peek(&lr);
+		vfs_node_put(found_node);
 		if (expect->node != found_node) {
 			rc = ENOENT;
@@ -841,7 +846,9 @@
 
 	/* If the node is not held by anyone, try to destroy it. */
-	if (vfs_node_peek(&lr) == NULL) {
+	vfs_node_t *node = vfs_node_peek(&lr);
+	if (!node)
 		out_destroy(&lr.triplet);
-	}
+	else
+		vfs_node_put(node);
 
 exit:
