diff --git a/dlls/kernel/computername.c b/dlls/kernel/computername.c
index c8845a9ff1f4caf40f6220aada6012ca2c074dc0..f6bd2562df1a5ff13f7250dddb41c00784a264a3 100644
--- a/dlls/kernel/computername.c
+++ b/dlls/kernel/computername.c
@@ -426,12 +426,13 @@ BOOL WINAPI GetComputerNameExA(COMPUTER_NAME_FORMAT type, LPSTR name, LPDWORD si
                 memcpy( name, buf, len );
                 name[len] = 0;
                 *size = len;
+                ret = TRUE;
             }
         }
         __EXCEPT(page_fault)
         {
             SetLastError( ERROR_INVALID_PARAMETER );
-            ret = FALSE;
+            return FALSE;
         }
         __ENDTRY
     }
@@ -476,26 +477,27 @@ BOOL WINAPI GetComputerNameExW( COMPUTER_NAME_FORMAT type, LPWSTR name, LPDWORD
         TRACE ("-> %s (%d)\n", debugstr_a (buf), len);
         __TRY
         {
-            int len = MultiByteToWideChar( CP_ACP, 0, buf, len, NULL, 0 );
-            if ( *size < len )
+            int lenW = MultiByteToWideChar( CP_ACP, 0, buf, len, NULL, 0 );
+            if ( *size < lenW )
             {
                 MultiByteToWideChar( CP_ACP, 0, buf, len, name, *size );
                 name[*size] = 0;
-                *size = len;
+                *size = lenW;
                 SetLastError( ERROR_MORE_DATA );
                 ret = FALSE;
             }
             else
             {
-                MultiByteToWideChar( CP_ACP, 0, buf, len, name, len );
-                name[len] = 0;
-                *size = len;
+                MultiByteToWideChar( CP_ACP, 0, buf, len, name, lenW );
+                name[lenW] = 0;
+                *size = lenW;
+                ret = TRUE;
             }
         }
         __EXCEPT(page_fault)
         {
             SetLastError( ERROR_INVALID_PARAMETER );
-            ret = FALSE;
+            return FALSE;
         }
         __ENDTRY
     }
diff --git a/programs/rundll32/rundll32.c b/programs/rundll32/rundll32.c
index a978d36b39f1b7259b8807001c57656c5e7e1525..16f56e5fd12a5ac76b36424c16c5e251e61fcff3 100644
--- a/programs/rundll32/rundll32.c
+++ b/programs/rundll32/rundll32.c
@@ -101,7 +101,7 @@ int main(int argc, char* argv[])
     /* try loading the UNICODE version first */
     strcpy(szEntryPoint,comma+1);
     strcat(szEntryPoint,"W");
-    pfEntryPointW=LoadProc(szDllName, szEntryPoint, &DllHandle);
+    pfEntryPointW=(EntryPointW)LoadProc(szDllName, szEntryPoint, &DllHandle);
     if(pfEntryPointW!=NULL)
     {
         WCHAR wszCmdLine[2048];
@@ -112,11 +112,11 @@ int main(int argc, char* argv[])
     {
         strcpy(szEntryPoint,comma+1);
         strcat(szEntryPoint,"A");
-        pfEntryPointA=LoadProc(szDllName, szEntryPoint, &DllHandle);
+        pfEntryPointA=(EntryPointA)LoadProc(szDllName, szEntryPoint, &DllHandle);
         if(pfEntryPointA==NULL)
         {
             strcpy(szEntryPoint,comma+1);
-            pfEntryPointA=LoadProc(szDllName, szEntryPoint, &DllHandle);
+            pfEntryPointA=(EntryPointA)LoadProc(szDllName, szEntryPoint, &DllHandle);
             if(pfEntryPointA==NULL)
                 return 0;
         }