diff --git a/src/Renderer.js b/src/Renderer.js
index 4ecee03373e0d1fa36f8bbe8e60af3dfdfdfe450..add8309137c5342ffffad21bb65cf5b1f75d9b7e 100644
--- a/src/Renderer.js
+++ b/src/Renderer.js
@@ -145,7 +145,7 @@ TextEnvironment.prototype._renderCloseText = function(node) {
                             node.children, newTextStyle);
     if (node.whitespace) this._html.putText(' ');
     this._html.putSpan(closeTextEnv.renderToHTML());
-}
+};
 
 TextEnvironment.prototype.renderToHTML = function() {
     this._html = new HTMLBuilder();
@@ -209,7 +209,7 @@ TextEnvironment.prototype.renderToHTML = function() {
             // \CALL{funcName}{funcArgs}
             // ==>
             // funcName(funcArgs)
-            this._html.beginSpan('ps-funcname').putText(text).endSpan()
+            this._html.beginSpan('ps-funcname').putText(text).endSpan();
             this._html.write('(');
             var argsTextNode = node.children[0];
             this._renderCloseText(argsTextNode);
@@ -413,6 +413,8 @@ function RendererOptions(options) {
     this.lineNumberPunc = options.lineNumberPunc || ':';
     this.lineNumber = options.lineNumber !== undefined ? options.lineNumber : false;
     this.noEnd = options.noEnd !== undefined ? options.noEnd : false;
+    if (options.captionCount !== undefined)
+        Renderer.captionCount = options.captionCount;
 }
 
 RendererOptions.prototype._parseEmVal = function(emVal) {
@@ -438,7 +440,7 @@ function Renderer(parser, options) {
 }
 
 /*  The global counter for the numbering of the algorithm environment */
-Renderer._captionCount = 0;
+Renderer.captionCount = 0;
 
 Renderer.prototype.toMarkup = function() {
     var html = this._html = new HTMLBuilder();
@@ -567,7 +569,7 @@ Renderer.prototype._buildTree = function(node) {
             child = node.children[ci];
             if (child.type !== 'caption') continue;
             lastCaptionNode = child;
-            Renderer._captionCount++;
+            Renderer.captionCount++;
         }
         // Then, build the header for algorithm
         if (lastCaptionNode) {
@@ -748,7 +750,7 @@ Renderer.prototype._buildTree = function(node) {
         break;
     case 'caption':
         this._newLine();
-        this._typeKeyword('Algorithm ' + Renderer._captionCount + ' ');
+        this._typeKeyword('Algorithm ' + Renderer.captionCount + ' ');
         textNode = node.children[0];
         this._buildTree(textNode);
         break;
diff --git a/static/test-suite.html b/static/test-suite.html
index 2c0ca2862512fcbd014cef750c8afa786e1867b3..252729be978dae432e32d05255848d3235d44b87 100644
--- a/static/test-suite.html
+++ b/static/test-suite.html
@@ -137,6 +137,7 @@
         });
         var testExamples = document.getElementById("test-examples").textContent;
         pseudocode.render(testExamples, document.body, {
+            captionCount: 0,
             lineNumber: true,
             noEnd: false
         });