--- a/src/parser/parser.y
+++ b/src/parser/parser.y
@@ -31,6 +31,7 @@
        #include <string.h>
 
 #include "tparser.h"
+#include "tparserprivate.h"
 
        int yylex (void);
        void yyerror (char const *);
@@ -52,7 +53,7 @@
 	free(*dest);
     *dest = strdup(from);
     if (*dest == NULL)
-	panoParserError("Not enough memory");
+	panoScriptParserError("Not enough memory");
 }
 
 
@@ -118,6 +119,8 @@
 	    if (script.inputImageSpec == NULL) {
 		yyerror("Not enough memory");
 	    }
+	    // clear the end of the reallocated region
+	    bzero(&(script.inputImageSpec[script.iInputImagesCount-1]), sizeof(*script.inputImageSpec));
 	    image = &script.inputImageSpec[script.iInputImagesCount-1];
         }   
         vars eoln      { ; }
@@ -132,6 +135,8 @@
 	    if (script.outputImageSpec == NULL) {
 		yyerror("Not enough memory");
 	    }
+	    // clear the end of the reallocated region
+	    bzero(&(script.outputImageSpec[script.iOutputImagesCount-1]), sizeof(*script.outputImageSpec));
 	    image = &script.outputImageSpec[script.iOutputImagesCount-1];
 	}      vars eoln      { ; }
 
@@ -179,13 +184,13 @@
 		image->coefIndex[6] = imageRef;
 		break;
 	   default:
-	       panoParserError("Invalid variable name [%c] in input line\n", $1);
+	       panoScriptParserError("Invalid variable name [%c] in input line\n", $1);
 	       return -1;
 	       break;
 	   }
 	   break;
        default:
-	   panoParserError("Error Not handled 3 [%c]\n", $1);
+	   panoScriptParserError("Error Not handled 3 [%c]\n", $1);
 	   return -1;
        }
    }
@@ -206,12 +211,12 @@
 		image->cropArea[3] = $8;
 		break;
 	    default:
-		panoParserError("Invalid variable name [%c] in image line\n", $1);
+		panoScriptParserError("Invalid variable name [%c] in image line\n", $1);
 		return -1;
 	    }
 	    break;
 	default:
-	    panoParserError("Error Not handled 3\n");
+	    panoScriptParserError("Error Not handled 3\n");
 	    return -1;
 	}
     }
@@ -234,10 +239,10 @@
 		ParserStringCopy(&script.pano.outputFormat, $2);
 		break;
 	    case 'P':
-		ParserStringCopy(&script.pano.projectionParms, $2);
-		break;
-	    default:
-		panoParserError("Invalid variable name [%c] in pano line\n", $1);
+		ParserStringCopy(&script.pano.projectionParmsString, $2);
+		break;
+	    default:
+		panoScriptParserError("Invalid variable name [%c] in pano line\n", $1);
 		return -1;
 	    }
 	    break;
@@ -248,12 +253,12 @@
 		ParserStringCopy(&image->name, $2);
 		break;
 	    default:
-		panoParserError("Invalid variable name [%c] in image line\n", $1);
+		panoScriptParserError("Invalid variable name [%c] in image line\n", $1);
 		return -1;
 	    }
 	    break;
 	default:
-	    panoParserError("Error Not handled case [%c]\n", $1);
+	    panoScriptParserError("Error Not handled case [%c]\n", $1);
 	    return -1;
 	}
     }
@@ -276,7 +281,7 @@
 		script.pano.fHorFOV = $2;
 		break;
 	    default:
-		panoParserError("Invalid variable name [%c] in pano line\n", $1);
+		panoScriptParserError("Invalid variable name [%c] in pano line\n", $1);
 		return -1;
 	    }
 	    break;
@@ -322,7 +327,7 @@
 		printf("Option %c in image line deprecated. \n", $1);
 		break;
 	    default:
-		panoParserError("Invalid variable name [%c] in image line\n", $1);
+		panoScriptParserError("Invalid variable name [%c] in image line\n", $1);
 		return -1;
 	    }
 	    break;
@@ -341,12 +346,12 @@
 		script.optimize.humberEstimator = $2;
 		break;
 	    default:
-		panoParserError("Invalid variable name [%c] in optimize line\n", $1);
+		panoScriptParserError("Invalid variable name [%c] in optimize line\n", $1);
 		return -1;
 	    }
 	    break;
 	default:
-	    panoParserError("Error. Not handled (token int [%c]\n", $1);
+	    panoScriptParserError("Error. Not handled (token int [%c]\n", $1);
 	    return -1;
 	}
     }
@@ -360,7 +365,7 @@
 		script.pano.fHorFOV = $2;
 		break;
 	    default:
-		panoParserError("Invalid variable name [%c] in output line\n", $1);
+		panoScriptParserError("Invalid variable name [%c] in output line\n", $1);
 		return -1;
 	    }
 	    break;
@@ -393,7 +398,7 @@
 		image->coef[6] = $2;
 		break;
 	    default:
-		panoParserError("Invalid variable name [%c] in pano line\n", $1);
+		panoScriptParserError("Invalid variable name [%c] in pano line\n", $1);
 		return -1;
 	    }
 	    break;
@@ -403,7 +408,7 @@
 		script.optimize.fGamma = $2;
 		break;
 	    default:
-		panoParserError("Invalid variable name [%c] in optimize line\n", $1);
+		panoScriptParserError("Invalid variable name [%c] in optimize line\n", $1);
 		return -1;
 	    }
 	    break;