Index: uspace/app/bdsh/cmds/modules/cp/cp.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cp/cp.c	(revision 0b97336d11bcc58a2ceb2de62e7d789187fda193)
+++ uspace/app/bdsh/cmds/modules/cp/cp.c	(revision 38aaf00508acfd26f9d005fe19c221720104ca88)
@@ -386,5 +386,5 @@
 	}
 
-	if (-1 == (fd2 = open(dest, O_CREAT))) {
+	if (-1 == (fd2 = open(dest, O_WRONLY | O_CREAT))) {
 		printf("Unable to open destination file %s\n", dest);
 		close(fd1);
Index: uspace/app/tester/mm/pager1.c
===================================================================
--- uspace/app/tester/mm/pager1.c	(revision 0b97336d11bcc58a2ceb2de62e7d789187fda193)
+++ uspace/app/tester/mm/pager1.c	(revision 38aaf00508acfd26f9d005fe19c221720104ca88)
@@ -48,5 +48,5 @@
 	TPRINTF("Creating temporary file...\n");
 
-	fd = open(TEST_FILE, O_CREAT);
+	fd = open(TEST_FILE, O_RDWR | O_CREAT);
 	if (fd < 0)
 		return NULL;
Index: uspace/app/tester/vfs/vfs1.c
===================================================================
--- uspace/app/tester/vfs/vfs1.c	(revision 0b97336d11bcc58a2ceb2de62e7d789187fda193)
+++ uspace/app/tester/vfs/vfs1.c	(revision 38aaf00508acfd26f9d005fe19c221720104ca88)
@@ -76,5 +76,5 @@
 	TPRINTF("Created directory %s\n", TEST_DIRECTORY);
 	
-	int fd0 = open(TEST_FILE, O_CREAT);
+	int fd0 = open(TEST_FILE, O_RDWR | O_CREAT);
 	if (fd0 < 0)
 		return "open() failed";
Index: uspace/lib/c/generic/vfs/vfs.c
===================================================================
--- uspace/lib/c/generic/vfs/vfs.c	(revision 0b97336d11bcc58a2ceb2de62e7d789187fda193)
+++ uspace/lib/c/generic/vfs/vfs.c	(revision 38aaf00508acfd26f9d005fe19c221720104ca88)
@@ -388,10 +388,11 @@
 int open(const char *path, int oflag, ...)
 {
-	// FIXME: Some applications call this incorrectly.
-	if ((oflag & (O_RDONLY|O_WRONLY|O_RDWR)) == 0) {
-		oflag |= O_RDWR;
-	}
-
-	assert((((oflag & O_RDONLY) != 0) + ((oflag & O_WRONLY) != 0) + ((oflag & O_RDWR) != 0)) == 1);
+	if (((oflag & (O_RDONLY | O_WRONLY | O_RDWR)) == 0) ||
+	    ((oflag & (O_RDONLY | O_WRONLY)) == (O_RDONLY | O_WRONLY)) ||
+	    ((oflag & (O_RDONLY | O_RDWR)) == (O_RDONLY | O_RDWR)) ||
+	    ((oflag & (O_WRONLY | O_RDWR)) == (O_WRONLY | O_RDWR))) {
+		errno = EINVAL;
+		return -1;
+	}
 	
 	int fd = vfs_lookup(path, walk_flags(oflag) | WALK_REGULAR);
