Bug fixes.

diff --git a/loader/module.c b/loader/module.c
index eae2b37..ebbceac 100644
--- a/loader/module.c
+++ b/loader/module.c
@@ -864,6 +864,10 @@
     pdb = PROCESS_IdToPDB( info.dwProcessId );
     tdb = pdb? (TDB *)GlobalLock16( pdb->task ) : NULL;
     hInstance = tdb && tdb->hInstance? tdb->hInstance : pdb? pdb->task : 0;
+    /* If there is no hInstance (32-bit process) return a dummy value
+     * that must be > 31
+     * FIXME: should do this in all cases and fix Win16 callers */
+    if (!hInstance) hInstance = 33;
 
     /* Close off the handles */
     CloseHandle( info.hThread );
diff --git a/loader/task.c b/loader/task.c
index 7f3d025..3867770 100644
--- a/loader/task.c
+++ b/loader/task.c
@@ -411,7 +411,7 @@
     pTask->thdb->teb.htask16 = pTask->thdb->process->task = hTask;
      TRACE_(task)("module='%s' cmdline='%s' task=%04x\n", name, cmd_line, hTask );
 
-    if (pTask->flags & TDBF_WIN32) return;
+    if (pTask->flags & TDBF_WIN32) return TRUE;
 
     /* If we have a DGROUP/hInstance, use it for 16-bit stack */