diff --git a/lib/modules/Stdio.pmod b/lib/modules/Stdio.pmod
index 52578e0998d61884a4d43705148ce0fc36b7660f..b0a2a747834c94d08bef45aa45cfdfa1ad296c4e 100644
--- a/lib/modules/Stdio.pmod
+++ b/lib/modules/Stdio.pmod
@@ -25,7 +25,14 @@ class File
   int open_socket(int|void port, string|void address)
   {
     _fd=Fd();
-    return ::open_socket(port, address);
+    switch(query_num_arg()) {
+    case 0:
+      return ::open_socket();
+    case 1:
+      return ::open_socket(port);
+    default:
+      return ::open_socket(port, address);
+    }
   }
 
   int connect(string host, int port)