diff --git a/src/python/build_pyrte.com b/src/python/build_pyrte.com
index 79a6d8efb363fb653276fe275d68dc4d388a0617_c3JjL3B5dGhvbi9idWlsZF9weXJ0ZS5jb20=..90398408928b6eacc849c0c2570a22884c141003_c3JjL3B5dGhvbi9idWlsZF9weXJ0ZS5jb20= 100755
--- a/src/python/build_pyrte.com
+++ b/src/python/build_pyrte.com
@@ -10,7 +10,7 @@
 $! VERSION HISTORY
 $! ---------------
 $!
-$ IMAGE_IDENT = "PYRTE113"
+$ IMAGE_IDENT = "PYRTE114"
 $!
 $! 22-APR-2007  JFP  use same build options as Python
 $! 10-APR-2007  MGD  initial
diff --git a/src/python/pyrte.c b/src/python/pyrte.c
index 79a6d8efb363fb653276fe275d68dc4d388a0617_c3JjL3B5dGhvbi9weXJ0ZS5j..90398408928b6eacc849c0c2570a22884c141003_c3JjL3B5dGhvbi9weXJ0ZS5j 100755
--- a/src/python/pyrte.c
+++ b/src/python/pyrte.c
@@ -271,6 +271,7 @@
 
 VERSION HISTORY (update SOFTWAREVN as well!)
 ---------------
+08-DEC-2009  JFP  v1.1.4, fix bugs introduced in 1.1.3
 07-DEC-2009  JFP  v1.1.3, os.environ is not a dictionary on OpenVMS
 19-APR-2008  JFP  v1.1.2, WSGI buffered output (see description above)
 17-JAN-2008  MGD  v1.1.1, CgiVar() and CgiVarDclSymbol() ensure an empty
@@ -281,7 +282,7 @@
 /*****************************************************************************/
 
 #define SOFTWARECR "Copyright (C) 2007-2009 Mark G.Daniel"
-#define SOFTWAREVN "1.1.3"
+#define SOFTWAREVN "1.1.4"
 #define SOFTWARENM "PYRTE"
 #ifdef __ALPHA
 #  define SOFTWAREID SOFTWARENM " AXP-" SOFTWAREVN
@@ -1596,8 +1597,8 @@
                   key = PyString_AsString(pKey);
                   pValue = PyMapping_GetItemString(pOsEnvironDict, key);
                   retval = PyMapping_SetItemString(pEnvironDict, key, pValue);
-                  if (retval = -1)
+                  if (retval == -1)
                   {
                       ReportError (__LINE__, 0, 1, ErrorCgiVarEnv);
                       return (0);
                   }
@@ -1600,7 +1601,8 @@
                   {
                       ReportError (__LINE__, 0, 1, ErrorCgiVarEnv);
                       return (0);
                   }
+                  Py_DECREF(pValue);
               }
           }
           Py_DECREF(pKeys);
@@ -1629,9 +1631,14 @@
          *sptr = '\0';
          pValue = PyString_FromString (sptr+1);
          retval = PyMapping_SetItemString (pEnvironDict, cptr, pValue);
+         if (retval == -1)
+         {
+            ReportError (__LINE__, 0, 1, ErrorCgiVarEnv);
+            return (0);
+         }
          Py_DECREF (pValue);
          *sptr = '=';
       }
 
       DEBUGPYOBJ("pEnvironDict",pEnvironDict)
       retval = PyDict_SetItemString (pOsDict, "environ", pEnvironDict);
@@ -1632,11 +1639,16 @@
          Py_DECREF (pValue);
          *sptr = '=';
       }
 
       DEBUGPYOBJ("pEnvironDict",pEnvironDict)
       retval = PyDict_SetItemString (pOsDict, "environ", pEnvironDict);
+      if (retval == -1)
+      {
+         ReportError (__LINE__, 0, 1, ErrorCgiVarEnv);
+         return (0);
+      }
       if (Debug) fprintf (stdout, "PyMapping_SetItemString() %d\n", retval);
    }
    else
    {
       DEBUGPYOBJ("1pEnvironDict",pEnvironDict)
@@ -1638,9 +1650,10 @@
       if (Debug) fprintf (stdout, "PyMapping_SetItemString() %d\n", retval);
    }
    else
    {
       DEBUGPYOBJ("1pEnvironDict",pEnvironDict)
-      PyObject_CallMethod(pOsEnvironDict, "clear", "()");
+      pValue = PyObject_CallMethod(pEnvironDict, "clear", "()");
+      Py_DECREF (pValue);
       DEBUGPYOBJ("2pEnvironDict",pEnvironDict)
    }