diff --git a/Makefile b/Makefile
index 80003bdf6..3484ab414 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-REPO = git@github.com:andreasgal/pdf.js.git
+REPO = git@github.com:mozilla/pdf.js.git
 BUILD_DIR := build
 BUILD_TARGET := $(BUILD_DIR)/pdf.js
 DEFAULT_BROWSERS := resources/browser_manifests/browser_manifest.json
diff --git a/README.md b/README.md
index 42669da28..8414ad2a9 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ successful.
 
 For an online demo, visit:
 
-+ http://andreasgal.github.com/pdf.js/web/viewer.html
++ http://mozilla.github.com/pdf.js/web/viewer.html
 
 This demo provides an interactive interface for displaying and browsing PDFs
 using the pdf.js API.
@@ -31,7 +31,7 @@ using the pdf.js API.
 
 A Firefox extension is also available:
 
-+ http://andreasgal.github.com/pdf.js/extensions/firefox/pdf.js.xpi
++ http://mozilla.github.com/pdf.js/extensions/firefox/pdf.js.xpi
 
 However, note that the extension might not reflect the latest source in our master branch.
 
@@ -39,7 +39,7 @@ However, note that the extension might not reflect the latest source in our mast
 
 To get a local copy of the current code, clone it using git:
 
-    $ git clone git://github.com/andreasgal/pdf.js.git pdfjs
+    $ git clone git://github.com/mozilla/pdf.js.git pdfjs
     $ cd pdfjs
 
 Next, you need to start a local web server as some browsers don't allow opening
@@ -73,7 +73,7 @@ Additional resources are available in a separate section below.
 
 For a "hello world" example, take a look at:
 
-+ [examples/helloworld/hello.js](https://github.com/andreasgal/pdf.js/blob/master/examples/helloworld/hello.js)
++ [examples/helloworld/hello.js](https://github.com/mozilla/pdf.js/blob/master/examples/helloworld/hello.js)
 
 This example illustrates the bare minimum ingredients for integrating pdf.js
 in a custom project.
@@ -92,19 +92,19 @@ workings of PDF and pdf.js:
 
 pdf.js is a community-driven project, so contributors are always welcome. 
 Simply fork our repo and contribute away. A great place to start is our
-[open issues](https://github.com/andreasgal/pdf.js/issues). For better consistency and 
+[open issues](https://github.com/mozilla/pdf.js/issues). For better consistency and 
 long-term stability, please do look around the code and try to follow our conventions.
 More information about the contributor process can be found on the 
-[contributor wiki page](https://github.com/andreasgal/pdf.js/wiki/Contributing).
+[contributor wiki page](https://github.com/mozilla/pdf.js/wiki/Contributing).
 
 If you don't want to hack on the project or have little spare time, __you still
 can help!__ Just open PDFs in the 
-[online demo](http://andreasgal.github.com/pdf.js/web/viewer.html) and report 
+[online demo](http://mozilla.github.com/pdf.js/web/viewer.html) and report 
 any breakage in rendering.
 
 Our Github contributors so far:
 
-+ https://github.com/andreasgal/pdf.js/contributors
++ https://github.com/mozilla/pdf.js/contributors
 
 You can add your name to it! :)
 
@@ -143,14 +143,14 @@ against reference images before merging pull requests.
 
 See the bot repo for details:
 
-+ https://github.com/arturadib/pdf.js-bot
++ https://github.com/mozilla/pdf.js-bot
 
 
 ## Additional resources
 
 Our demo site is here:
 
-+ http://andreasgal.github.com/pdf.js/web/viewer.html
++ http://mozilla.github.com/pdf.js/web/viewer.html
 
 You can read more about pdf.js here:
 
diff --git a/extensions/firefox/bootstrap.js b/extensions/firefox/bootstrap.js
index 5384a05df..e51df28f8 100644
--- a/extensions/firefox/bootstrap.js
+++ b/extensions/firefox/bootstrap.js
@@ -16,21 +16,31 @@ function log(str) {
 
 function startup(aData, aReason) {
   let manifestPath = 'chrome.manifest';
-  let file = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsILocalFile);
+  let manifest = Cc['@mozilla.org/file/local;1']
+                   .createInstance(Ci.nsILocalFile);
   try {
-    file.initWithPath(aData.installPath.path);
-    file.append(manifestPath);
-    Cm.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(file);
+    manifest.initWithPath(aData.installPath.path);
+    manifest.append(manifestPath);
+    Cm.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(manifest);
+    Services.prefs.setBoolPref('extensions.pdf.js.active', true);
   } catch (e) {
     log(e);
   }
 }
 
 function shutdown(aData, aReason) {
+  if (Services.prefs.getBoolPref('extensions.pdf.js.active'))
+    Services.prefs.setBoolPref('extensions.pdf.js.active', false);
 }
 
 function install(aData, aReason) {
   let url = 'chrome://pdf.js/content/web/viewer.html?file=%s';
   Services.prefs.setCharPref('extensions.pdf.js.url', url);
+  Services.prefs.setBoolPref('extensions.pdf.js.active', false);
+}
+
+function uninstall(aData, aReason) {
+  Services.prefs.clearUserPref('extensions.pdf.js.url');
+  Services.prefs.clearUserPref('extensions.pdf.js.active');
 }
 
diff --git a/extensions/firefox/components/pdfContentHandler.js b/extensions/firefox/components/pdfContentHandler.js
index 7746e41b6..444db1c1f 100644
--- a/extensions/firefox/components/pdfContentHandler.js
+++ b/extensions/firefox/components/pdfContentHandler.js
@@ -32,6 +32,9 @@ pdfContentHandler.prototype = {
     if (!(aRequest instanceof Ci.nsIChannel))
       throw NS_ERROR_WONT_HANDLE_CONTENT;
 
+    if (!Services.prefs.getBoolPref('extensions.pdf.js.active'))
+      throw NS_ERROR_WONT_HANDLE_CONTENT;
+
     let window = null;
     let callbacks = aRequest.notificationCallbacks ||
                     aRequest.loadGroup.notificationCallbacks;
@@ -53,7 +56,7 @@ pdfContentHandler.prototype = {
       throw NS_ERROR_WONT_HANDLE_CONTENT;
 
     aRequest.cancel(Cr.NS_BINDING_ABORTED);
-    window.location = url.replace('%s', targetUrl);
+    window.location = url.replace('%s', encodeURIComponent(targetUrl));
   },
 
   classID: Components.ID('{2278dfd0-b75c-11e0-8257-1ba3d93c9f1a}'),
diff --git a/extensions/firefox/install.rdf b/extensions/firefox/install.rdf
index 0dfd6bf57..26b2192b6 100644
--- a/extensions/firefox/install.rdf
+++ b/extensions/firefox/install.rdf
@@ -19,6 +19,6 @@
     <em:unpack>true</em:unpack>
     <em:creator>Vivien Nicolas</em:creator>
     <em:description>pdf.js uri loader</em:description>
-    <em:homepageURL>https://github.com/andreasgal/pdf.js/</em:homepageURL>
+    <em:homepageURL>https://github.com/mozilla/pdf.js/</em:homepageURL>
   </Description>
 </RDF>
diff --git a/src/canvas.js b/src/canvas.js
index d5db79446..1ed1ab76d 100644
--- a/src/canvas.js
+++ b/src/canvas.js
@@ -1,8 +1,11 @@
-// <canvas> contexts store most of the state we need natively.
-// However, PDF needs a bit more state, which we store here.
+/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
 
 'use strict';
 
+// <canvas> contexts store most of the state we need natively.
+// However, PDF needs a bit more state, which we store here.
+
 var CanvasExtraState = (function canvasExtraState() {
   function constructor(old) {
     // Are soft masks and alpha values shapes or opacities?
@@ -21,13 +24,18 @@ var CanvasExtraState = (function canvasExtraState() {
     this.wordSpacing = 0;
     this.textHScale = 1;
     // Color spaces
+    this.fillColorSpace = new DeviceGrayCS;
     this.fillColorSpaceObj = null;
+    this.strokeColorSpace = new DeviceGrayCS;
     this.strokeColorSpaceObj = null;
     this.fillColorObj = null;
     this.strokeColorObj = null;
     // Default fore and background colors
     this.fillColor = '#000000';
     this.strokeColor = '#000000';
+    // Note: fill alpha applies to all non-stroking operations
+    this.fillAlpha = 1;
+    this.strokeAlpha = 1;
 
     this.old = old;
   }
@@ -243,6 +251,13 @@ var CanvasGraphics = (function canvasGraphics() {
           case 'Font':
             this.setFont(state[1], state[2]);
             break;
+          case 'CA':
+            this.current.strokeAlpha = state[1];
+            break;
+          case 'ca':
+            this.current.fillAlpha = state[1];
+            this.ctx.globalAlpha = state[1];
+            break;
         }
       }
     },
@@ -291,9 +306,13 @@ var CanvasGraphics = (function canvasGraphics() {
     rectangle: function canvasGraphicsRectangle(x, y, width, height) {
       this.ctx.rect(x, y, width, height);
     },
-    stroke: function canvasGraphicsStroke() {
+    stroke: function canvasGraphicsStroke(consumePath) {
+      consumePath = typeof consumePath !== 'undefined' ? consumePath : true;
       var ctx = this.ctx;
       var strokeColor = this.current.strokeColor;
+      // For stroke we want to temporarily change the global alpha to the
+      // stroking alpha.
+      ctx.globalAlpha = this.current.strokeAlpha;
       if (strokeColor && strokeColor.hasOwnProperty('type') &&
           strokeColor.type === 'Pattern') {
         // for patterns, we transform to pattern space, calculate
@@ -305,14 +324,17 @@ var CanvasGraphics = (function canvasGraphics() {
       } else {
         ctx.stroke();
       }
-
-      this.consumePath();
+      if (consumePath)
+        this.consumePath();
+      // Restore the global alpha to the fill alpha
+      ctx.globalAlpha = this.current.fillAlpha;
     },
     closeStroke: function canvasGraphicsCloseStroke() {
       this.closePath();
       this.stroke();
     },
-    fill: function canvasGraphicsFill() {
+    fill: function canvasGraphicsFill(consumePath) {
+      consumePath = typeof consumePath !== 'undefined' ? consumePath : true;
       var ctx = this.ctx;
       var fillColor = this.current.fillColor;
 
@@ -325,8 +347,8 @@ var CanvasGraphics = (function canvasGraphics() {
       } else {
         ctx.fill();
       }
-
-      this.consumePath();
+      if (consumePath)
+        this.consumePath();
     },
     eoFill: function canvasGraphicsEoFill() {
       var savedFillRule = this.setEOFillRule();
@@ -334,29 +356,8 @@ var CanvasGraphics = (function canvasGraphics() {
       this.restoreFillRule(savedFillRule);
     },
     fillStroke: function canvasGraphicsFillStroke() {
-      var ctx = this.ctx;
-
-      var fillColor = this.current.fillColor;
-      if (fillColor && fillColor.hasOwnProperty('type') &&
-          fillColor.type === 'Pattern') {
-        ctx.save();
-        ctx.fillStyle = fillColor.getPattern(ctx);
-        ctx.fill();
-        ctx.restore();
-      } else {
-        ctx.fill();
-      }
-
-      var strokeColor = this.current.strokeColor;
-      if (strokeColor && strokeColor.hasOwnProperty('type') &&
-          strokeColor.type === 'Pattern') {
-        ctx.save();
-        ctx.strokeStyle = strokeColor.getPattern(ctx);
-        ctx.stroke();
-        ctx.restore();
-      } else {
-        ctx.stroke();
-      }
+      this.fill(false);
+      this.stroke(false);
 
       this.consumePath();
     },
@@ -366,10 +367,12 @@ var CanvasGraphics = (function canvasGraphics() {
       this.restoreFillRule(savedFillRule);
     },
     closeFillStroke: function canvasGraphicsCloseFillStroke() {
-      return this.fillStroke();
+      this.closePath();
+      this.fillStroke();
     },
     closeEOFillStroke: function canvasGraphicsCloseEOFillStroke() {
       var savedFillRule = this.setEOFillRule();
+      this.closePath();
       this.fillStroke();
       this.restoreFillRule(savedFillRule);
     },
@@ -646,8 +649,7 @@ var CanvasGraphics = (function canvasGraphics() {
     },
 
     // Color
-    setStrokeColorSpace:
-    function canvasGraphicsSetStrokeColorSpacefunction(raw) {
+    setStrokeColorSpace: function canvasGraphicsSetStrokeColorSpace(raw) {
       this.current.strokeColorSpace = ColorSpace.fromIR(raw);
     },
     setFillColorSpace: function canvasGraphicsSetFillColorSpace(raw) {
@@ -658,7 +660,7 @@ var CanvasGraphics = (function canvasGraphics() {
       var color = cs.getRgb(arguments);
       this.setStrokeRGBColor.apply(this, color);
     },
-    getColorN_IR_Pattern: function(IR, cs) {
+    getColorN_IR_Pattern: function canvasGraphicsGetColorN_IR_Pattern(IR, cs) {
       if (IR[0] == 'TilingPattern') {
         var args = IR[1];
         var base = cs.base;
@@ -774,8 +776,8 @@ var CanvasGraphics = (function canvasGraphics() {
       error('Should not call beginImageData');
     },
 
-    paintFormXObjectBegin:
-    function canvasGraphicsPaintFormXObject(matrix, bbox) {
+    paintFormXObjectBegin: function canvasGraphicsPaintFormXObjectBegin(matrix,
+                                                                        bbox) {
       this.save();
 
       if (matrix && isArray(matrix) && 6 == matrix.length)
@@ -790,11 +792,11 @@ var CanvasGraphics = (function canvasGraphics() {
       }
     },
 
-    paintFormXObjectEnd: function() {
+    paintFormXObjectEnd: function canvasGraphicsPaintFormXObjectEnd() {
       this.restore();
     },
 
-    paintJpegXObject: function(objId, w, h) {
+    paintJpegXObject: function canvasGraphicsPaintJpegXObject(objId, w, h) {
       var image = this.objs.get(objId);
       if (!image) {
         error('Dependent image isn\'t ready yet');
@@ -813,7 +815,8 @@ var CanvasGraphics = (function canvasGraphics() {
       this.restore();
     },
 
-    paintImageMaskXObject: function(imgArray, inverseDecode, width, height) {
+    paintImageMaskXObject: function canvasGraphicsPaintImageMaskXObject(
+                             imgArray, inverseDecode, width, height) {
       function applyStencilMask(buffer, inverseDecode) {
         var imgArrayPos = 0;
         var i, j, mask, buf;
@@ -861,7 +864,7 @@ var CanvasGraphics = (function canvasGraphics() {
       this.restore();
     },
 
-    paintImageXObject: function(imgData) {
+    paintImageXObject: function canvasGraphicsPaintImageXObject(imgData) {
       this.save();
       var ctx = this.ctx;
       var w = imgData.width;
@@ -950,3 +953,4 @@ var CanvasGraphics = (function canvasGraphics() {
 
   return constructor;
 })();
+
diff --git a/src/cidmaps.js b/src/cidmaps.js
index 7de3d14f6..226843b71 100644
--- a/src/cidmaps.js
+++ b/src/cidmaps.js
@@ -6930,3 +6930,4 @@ var CIDToUnicodeMaps = {
     {f: 39, c: 19576}, {f: 111, c: 19620}, {f: 148, c: 19738},
     {f: 7, c: 19887}]
 };
+
diff --git a/src/colorspace.js b/src/colorspace.js
index 3ce383a09..6bfad4c39 100644
--- a/src/colorspace.js
+++ b/src/colorspace.js
@@ -12,17 +12,17 @@ var ColorSpace = (function colorSpaceColorSpace() {
   constructor.prototype = {
     // Input: array of size numComps representing color component values
     // Output: array of rgb values, each value ranging from [0.1]
-    getRgb: function cs_getRgb(color) {
+    getRgb: function colorSpaceGetRgb(color) {
       error('Should not call ColorSpace.getRgb: ' + color);
     },
     // Input: Uint8Array of component values, each value scaled to [0,255]
     // Output: Uint8Array of rgb values, each value scaled to [0,255]
-    getRgbBuffer: function cs_getRgbBuffer(input) {
+    getRgbBuffer: function colorSpaceGetRgbBuffer(input) {
       error('Should not call ColorSpace.getRgbBuffer: ' + input);
     }
   };
 
-  constructor.parse = function colorspace_parse(cs, xref, res) {
+  constructor.parse = function colorSpaceParse(cs, xref, res) {
     var IR = constructor.parseToIR(cs, xref, res, true);
     if (IR instanceof SeparationCS)
       return IR;
@@ -30,7 +30,7 @@ var ColorSpace = (function colorSpaceColorSpace() {
     return constructor.fromIR(IR);
   };
 
-  constructor.fromIR = function(IR) {
+  constructor.fromIR = function colorSpaceFromIR(IR) {
     var name;
     if (isArray(IR)) {
       name = IR[0];
@@ -71,7 +71,8 @@ var ColorSpace = (function colorSpaceColorSpace() {
     return null;
   }
 
-  constructor.parseToIR = function colorspace_parse(cs, xref, res, parseOnly) {
+  constructor.parseToIR = function colorSpaceParseToIR(cs, xref, res,
+                                                       parseOnly) {
     if (isName(cs)) {
       var colorSpaces = xref.fetchIfRef(res.get('ColorSpace'));
       if (isDict(colorSpaces)) {
@@ -397,5 +398,7 @@ var DeviceCmykCS = (function deviceCmykCS() {
       return rgbBuf;
     }
   };
+
   return constructor;
 })();
+
diff --git a/src/core.js b/src/core.js
index ab2509016..98cb456ad 100644
--- a/src/core.js
+++ b/src/core.js
@@ -153,7 +153,7 @@ var Page = (function pagePage() {
       return shadow(this, 'rotate', rotate);
     },
 
-    startRenderingFromIRQueue: function startRenderingFromIRQueue(
+    startRenderingFromIRQueue: function pageStartRenderingFromIRQueue(
                                                 IRQueue, fonts) {
       var self = this;
       this.IRQueue = IRQueue;
@@ -173,12 +173,13 @@ var Page = (function pagePage() {
         });
       };
 
-      this.ensureFonts(fonts, function() {
+      this.ensureFonts(fonts,
+                       function pageStartRenderingFromIRQueueEnsureFonts() {
         displayContinuation();
       });
     },
 
-    getIRQueue: function(handler, dependency) {
+    getIRQueue: function pageGetIRQueue(handler, dependency) {
       if (this.IRQueue) {
         // content was compiled
         return this.IRQueue;
@@ -202,7 +203,7 @@ var Page = (function pagePage() {
                                 content, resources, IRQueue, dependency);
     },
 
-    ensureFonts: function(fonts, callback) {
+    ensureFonts: function pageEnsureFonts(fonts, callback) {
       // Convert the font names to the corresponding font obj.
       for (var i = 0; i < fonts.length; i++) {
         fonts[i] = this.objs.objs[fonts[i]].data;
@@ -211,7 +212,7 @@ var Page = (function pagePage() {
       // Load all the fonts
       var fontObjs = FontLoader.bind(
         fonts,
-        function(fontObjs) {
+        function pageEnsureFontsFontObjs(fontObjs) {
           this.stats.fonts = Date.now();
 
           callback.call(this);
@@ -220,7 +221,7 @@ var Page = (function pagePage() {
       );
     },
 
-    display: function(gfx, callback) {
+    display: function pageDisplay(gfx, callback) {
       var xref = this.xref;
       var resources = xref.fetchIfRef(this.resources);
       var mediaBox = xref.fetchIfRef(this.mediaBox);
@@ -306,7 +307,7 @@ var Page = (function pagePage() {
       }
       return links;
     },
-    startRendering: function(ctx, callback, textLayer)  {
+    startRendering: function pageStartRendering(ctx, callback, textLayer)  {
       this.ctx = ctx;
       this.callback = callback;
       this.textLayer = textLayer;
@@ -448,7 +449,7 @@ var PDFDocModel = (function pdfDoc() {
   return constructor;
 })();
 
-var PDFDoc = (function() {
+var PDFDoc = (function pdfDoc() {
   function constructor(arg, callback) {
     var stream = null;
     var data = null;
@@ -477,10 +478,10 @@ var PDFDoc = (function() {
     } else {
       // If we don't use a worker, just post/sendMessage to the main thread.
       var worker = {
-        postMessage: function(obj) {
+        postMessage: function pdfDocPostMessage(obj) {
           worker.onmessage({data: obj});
         },
-        terminate: function() {}
+        terminate: function pdfDocTerminate() {}
       };
     }
     this.worker = worker;
@@ -490,7 +491,7 @@ var PDFDoc = (function() {
     var processorHandler = this.processorHandler =
                                         new MessageHandler('main', worker);
 
-    processorHandler.on('page', function(data) {
+    processorHandler.on('page', function pdfDocPage(data) {
       var pageNum = data.pageNum;
       var page = this.pageCache[pageNum];
       var depFonts = data.depFonts;
@@ -498,7 +499,7 @@ var PDFDoc = (function() {
       page.startRenderingFromIRQueue(data.IRQueue, depFonts);
     }, this);
 
-    processorHandler.on('obj', function(data) {
+    processorHandler.on('obj', function pdfDocObj(data) {
       var id = data[0];
       var type = data[1];
 
@@ -542,7 +543,7 @@ var PDFDoc = (function() {
       }
     }, this);
 
-    processorHandler.on('font_ready', function(data) {
+    processorHandler.on('font_ready', function pdfDocFontReady(data) {
       var id = data[0];
       var font = new FontShape(data[1]);
 
@@ -561,7 +562,7 @@ var PDFDoc = (function() {
     }
 
     this.workerReadyPromise = new Promise('workerReady');
-    setTimeout(function() {
+    setTimeout(function pdfDocFontReadySetTimeout() {
       processorHandler.send('doc', this.data);
       this.workerReadyPromise.resolve(true);
     }.bind(this));
@@ -572,14 +573,14 @@ var PDFDoc = (function() {
       return this.pdf.numPages;
     },
 
-    startRendering: function(page) {
+    startRendering: function pdfDocStartRendering(page) {
       // The worker might not be ready to receive the page request yet.
-      this.workerReadyPromise.then(function() {
+      this.workerReadyPromise.then(function pdfDocStartRenderingThen() {
         this.processorHandler.send('page_request', page.pageNumber + 1);
       }.bind(this));
     },
 
-    getPage: function(n) {
+    getPage: function pdfDocGetPage(n) {
       if (this.pageCache[n])
         return this.pageCache[n];
 
@@ -591,7 +592,7 @@ var PDFDoc = (function() {
       return this.pageCache[n] = page;
     },
 
-    destroy: function() {
+    destroy: function pdfDocDestroy() {
       if (this.worker)
         this.worker.terminate();
 
@@ -610,4 +611,6 @@ var PDFDoc = (function() {
 
   return constructor;
 })();
+
 globalScope.PDFJS.PDFDoc = PDFDoc;
+
diff --git a/src/crypto.js b/src/crypto.js
index 5699ea1df..2c86038f0 100644
--- a/src/crypto.js
+++ b/src/crypto.js
@@ -595,3 +595,4 @@ var CipherTransformFactory = (function cipherTransformFactory() {
 
   return constructor;
 })();
+
diff --git a/src/evaluator.js b/src/evaluator.js
index 5007394b4..b7a5ef583 100644
--- a/src/evaluator.js
+++ b/src/evaluator.js
@@ -405,6 +405,8 @@ var PartialEvaluator = (function partialEvaluator() {
                     case 'D':
                     case 'RI':
                     case 'FL':
+                    case 'CA':
+                    case 'ca':
                       gsStateObj.push([key, value]);
                       break;
                     case 'Font':
@@ -428,8 +430,6 @@ var PartialEvaluator = (function partialEvaluator() {
                     case 'SA':
                     case 'BM':
                     case 'SMask':
-                    case 'CA':
-                    case 'ca':
                     case 'AIS':
                     case 'TK':
                       TODO('graphic state operator ' + key);
@@ -918,3 +918,4 @@ var EvalState = (function evalState() {
   };
   return constructor;
 })();
+
diff --git a/src/fonts.js b/src/fonts.js
index f123b5f4c..b027b766a 100644
--- a/src/fonts.js
+++ b/src/fonts.js
@@ -3272,3 +3272,4 @@ var Type2CFF = (function type2CFF() {
 
   return constructor;
 })();
+
diff --git a/src/function.js b/src/function.js
index 0d4976ab0..a8c797a29 100644
--- a/src/function.js
+++ b/src/function.js
@@ -3,14 +3,15 @@
 
 'use strict';
 
-var PDFFunction = (function() {
+var PDFFunction = (function pdfFunction() {
   var CONSTRUCT_SAMPLED = 0;
   var CONSTRUCT_INTERPOLATED = 2;
   var CONSTRUCT_STICHED = 3;
   var CONSTRUCT_POSTSCRIPT = 4;
 
   return {
-    getSampleArray: function(size, outputSize, bps, str) {
+    getSampleArray: function pdfFunctionGetSampleArray(size, outputSize, bps,
+                                                       str) {
       var length = 1;
       for (var i = 0; i < size.length; i++)
         length *= size[i];
@@ -35,7 +36,7 @@ var PDFFunction = (function() {
       return array;
     },
 
-    getIR: function(xref, fn) {
+    getIR: function pdfFunctionGetIR(xref, fn) {
       var dict = fn.dict;
       if (!dict)
         dict = fn;
@@ -54,7 +55,7 @@ var PDFFunction = (function() {
       return typeFn.call(this, fn, dict, xref);
     },
 
-    fromIR: function(IR) {
+    fromIR: function pdfFunctionFromIR(IR) {
       var type = IR[0];
       switch (type) {
         case CONSTRUCT_SAMPLED:
@@ -69,12 +70,12 @@ var PDFFunction = (function() {
       }
     },
 
-    parse: function(xref, fn) {
+    parse: function pdfFunctionParse(xref, fn) {
       var IR = this.getIR(xref, fn);
       return this.fromIR(IR);
     },
 
-    constructSampled: function(str, dict) {
+    constructSampled: function pdfFunctionConstructSampled(str, dict) {
       var domain = dict.get('Domain');
       var range = dict.get('Range');
 
@@ -116,7 +117,7 @@ var PDFFunction = (function() {
       ];
     },
 
-    constructSampledFromIR: function(IR) {
+    constructSampledFromIR: function pdfFunctionConstructSampledFromIR(IR) {
       var inputSize = IR[1];
       var domain = IR[2];
       var encode = IR[3];
@@ -127,8 +128,8 @@ var PDFFunction = (function() {
       var bps = IR[8];
       var range = IR[9];
 
-      return function(args) {
-        var clip = function(v, min, max) {
+      return function constructSampledFromIRResult(args) {
+        var clip = function constructSampledFromIRClip(v, min, max) {
           if (v > max)
             v = max;
           else if (v < min)
@@ -212,7 +213,7 @@ var PDFFunction = (function() {
 
       var length = diff.length;
 
-      return function(args) {
+      return function constructInterpolatedFromIRResult(args) {
         var x = n == 1 ? args[0] : Math.pow(args[0], n);
 
         var out = [];
@@ -257,8 +258,8 @@ var PDFFunction = (function() {
         fns.push(PDFFunction.fromIR(fnsIR[i]));
       }
 
-      return function(args) {
-        var clip = function(v, min, max) {
+      return function constructStichedFromIRResult(args) {
+        var clip = function constructStichedFromIRClip(v, min, max) {
           if (v > max)
             v = max;
           else if (v < min)
@@ -298,9 +299,10 @@ var PDFFunction = (function() {
 
     constructPostScriptFromIR: function pdfFunctionConstructPostScriptFromIR() {
       TODO('unhandled type of function');
-      return function() {
+      return function constructPostScriptFromIRResult() {
         return [255, 105, 180];
       };
     }
   };
 })();
+
diff --git a/src/image.js b/src/image.js
index b997245a3..71aa0f113 100644
--- a/src/image.js
+++ b/src/image.js
@@ -229,12 +229,12 @@ var PDFImage = (function pdfImage() {
   return constructor;
 })();
 
-var JpegImage = (function() {
+var JpegImage = (function jpegImage() {
   function JpegImage(objId, imageData, objs) {
     var src = 'data:image/jpeg;base64,' + window.btoa(imageData);
 
     var img = new Image();
-    img.onload = (function() {
+    img.onload = (function jpegImageOnload() {
       this.loaded = true;
 
       objs.resolve(objId, this);
@@ -247,10 +247,11 @@ var JpegImage = (function() {
   }
 
   JpegImage.prototype = {
-    getImage: function() {
+    getImage: function jpegImageGetImage() {
       return this.domImage;
     }
   };
 
   return JpegImage;
 })();
+
diff --git a/src/metrics.js b/src/metrics.js
index d4d07ec0d..c21b4aed1 100644
--- a/src/metrics.js
+++ b/src/metrics.js
@@ -2941,3 +2941,4 @@ var Metrics = {
     'a191': 918
   }
 };
+
diff --git a/src/obj.js b/src/obj.js
index 03fbf2e0a..fd1579280 100644
--- a/src/obj.js
+++ b/src/obj.js
@@ -642,7 +642,7 @@ var XRef = (function xRefXRef() {
  * inside of a worker. The `PDFObjects` implements some basic functions to
  * manage these objects.
  */
-var PDFObjects = (function() {
+var PDFObjects = (function pdfObjects() {
   function PDFObjects() {
     this.objs = {};
   }
@@ -655,7 +655,7 @@ var PDFObjects = (function() {
      * Ensures there is an object defined for `objId`. Stores `data` on the
      * object *if* it is created.
      */
-    ensureObj: function(objId, data) {
+    ensureObj: function pdfObjectsEnsureObj(objId, data) {
       if (this.objs[objId])
         return this.objs[objId];
       return this.objs[objId] = new Promise(objId, data);
@@ -670,7 +670,7 @@ var PDFObjects = (function() {
      * function and the object is already resolved, the callback gets called
      * right away.
      */
-    get: function(objId, callback) {
+    get: function pdfObjectsGet(objId, callback) {
       // If there is a callback, then the get can be async and the object is
       // not required to be resolved right now
       if (callback) {
@@ -695,7 +695,7 @@ var PDFObjects = (function() {
     /**
      * Resolves the object `objId` with optional `data`.
      */
-    resolve: function(objId, data) {
+    resolve: function pdfObjectsResolve(objId, data) {
       var objs = this.objs;
 
       // In case there is a promise already on this object, just resolve it.
@@ -706,11 +706,11 @@ var PDFObjects = (function() {
       }
     },
 
-    onData: function(objId, callback) {
+    onData: function pdfObjectsOnData(objId, callback) {
       this.ensureObj(objId).onData(callback);
     },
 
-    isResolved: function(objId) {
+    isResolved: function pdfObjectsIsResolved(objId) {
       var objs = this.objs;
       if (!objs[objId]) {
         return false;
@@ -719,7 +719,7 @@ var PDFObjects = (function() {
       }
     },
 
-    hasData: function(objId) {
+    hasData: function pdfObjectsHasData(objId) {
       var objs = this.objs;
       if (!objs[objId]) {
         return false;
@@ -731,7 +731,7 @@ var PDFObjects = (function() {
     /**
      * Sets the data of an object but *doesn't* resolve it.
      */
-    setData: function(objId, data) {
+    setData: function pdfObjectsSetData(objId, data) {
       // Watchout! If you call `this.ensureObj(objId, data)` you're going to
       // create a *resolved* promise which shouldn't be the case!
       this.ensureObj(objId).data = data;
@@ -739,3 +739,4 @@ var PDFObjects = (function() {
   };
   return PDFObjects;
 })();
+
diff --git a/src/parser.js b/src/parser.js
index 79a336d7f..a740615ed 100644
--- a/src/parser.js
+++ b/src/parser.js
@@ -633,3 +633,4 @@ var Linearization = (function linearizationLinearization() {
 
   return constructor;
 })();
+
diff --git a/src/pattern.js b/src/pattern.js
index a551ac411..2a31fec4a 100644
--- a/src/pattern.js
+++ b/src/pattern.js
@@ -97,7 +97,7 @@ Shadings.RadialAxial = (function radialAxialShading() {
     this.colorStops = colorStops;
   }
 
-  constructor.fromIR = function(ctx, raw) {
+  constructor.fromIR = function radialAxialShadingGetIR(ctx, raw) {
     var type = raw[1];
     var colorStops = raw[2];
     var p0 = raw[3];
@@ -129,7 +129,7 @@ Shadings.RadialAxial = (function radialAxialShading() {
   }
 
   constructor.prototype = {
-    getIR: function RadialAxialShading_getIR() {
+    getIR: function radialAxialShadingGetIR() {
       var coordsArr = this.coordsArr;
       var type = this.shadingType;
       if (type == 2) {
@@ -164,12 +164,12 @@ Shadings.Dummy = (function dummyShading() {
     this.type = 'Pattern';
   }
 
-  constructor.fromIR = function() {
+  constructor.fromIR = function dummyShadingFromIR() {
     return 'hotpink';
   }
 
   constructor.prototype = {
-    getIR: function dummpy_getir() {
+    getIR: function dummyShadingGetIR() {
       return ['Dummy'];
     }
   };
@@ -287,3 +287,4 @@ var TilingPattern = (function tilingPattern() {
 
   return TilingPattern;
 })();
+
diff --git a/src/pdf.js b/src/pdf.js
index b2b8df7aa..34e163967 100644
--- a/src/pdf.js
+++ b/src/pdf.js
@@ -12,3 +12,4 @@ var PDFJS = {};
   /* PDFJSSCRIPT_INCLUDE_ALL */
 
 })();
+
diff --git a/src/stream.js b/src/stream.js
index baebc3190..73b096f1e 100644
--- a/src/stream.js
+++ b/src/stream.js
@@ -801,7 +801,7 @@ var JpegStream = (function jpegStream() {
   }
 
   constructor.prototype = {
-    getIR: function() {
+    getIR: function jpegStreamGetIR() {
       return this.src;
     },
     getChar: function jpegStreamGetChar() {
@@ -2073,3 +2073,4 @@ var LZWStream = (function lzwStream() {
 
   return constructor;
 })();
+
diff --git a/src/util.js b/src/util.js
index 344b99e53..41ae4cc96 100644
--- a/src/util.js
+++ b/src/util.js
@@ -16,16 +16,15 @@ function warn(msg) {
 }
 
 function backtrace() {
-  var stackStr;
   try {
     throw new Error();
   } catch (e) {
-    stackStr = e.stack;
+    return e.stack ? e.stack.split('\n').slice(2).join('\n') : '';
   }
-  return stackStr.split('\n').slice(1).join('\n');
 }
 
 function error(msg) {
+  log('Error: ' + msg);
   log(backtrace());
   throw new Error(msg);
 }
@@ -198,7 +197,7 @@ function isPDFFunction(v) {
  * can be set. If any of these happens twice or the data is required before
  * it was set, an exception is throw.
  */
-var Promise = (function() {
+var Promise = (function promise() {
   var EMPTY_PROMISE = {};
 
   /**
@@ -222,19 +221,19 @@ var Promise = (function() {
   Promise.prototype = {
     hasData: false,
 
-    set data(data) {
-      if (data === undefined) {
+    set data(value) {
+      if (value === undefined) {
         return;
       }
       if (this._data !== EMPTY_PROMISE) {
         throw 'Promise ' + this.name +
                                 ': Cannot set the data of a promise twice';
       }
-      this._data = data;
+      this._data = value;
       this.hasData = true;
 
       if (this.onDataCallback) {
-        this.onDataCallback(data);
+        this.onDataCallback(value);
       }
     },
 
@@ -245,7 +244,7 @@ var Promise = (function() {
       return this._data;
     },
 
-    onData: function(callback) {
+    onData: function promiseOnData(callback) {
       if (this._data !== EMPTY_PROMISE) {
         callback(this._data);
       } else {
@@ -253,7 +252,7 @@ var Promise = (function() {
       }
     },
 
-    resolve: function(data) {
+    resolve: function promiseResolve(data) {
       if (this.isResolved) {
         throw 'A Promise can be resolved only once ' + this.name;
       }
@@ -267,7 +266,7 @@ var Promise = (function() {
       }
     },
 
-    then: function(callback) {
+    then: function promiseThen(callback) {
       if (!callback) {
         throw 'Requiring callback' + this.name;
       }
@@ -281,5 +280,7 @@ var Promise = (function() {
       }
     }
   };
+
   return Promise;
 })();
+
diff --git a/src/worker.js b/src/worker.js
index d1ab48458..d62e0c86b 100644
--- a/src/worker.js
+++ b/src/worker.js
@@ -8,14 +8,14 @@ function MessageHandler(name, comObj) {
   this.comObj = comObj;
   var ah = this.actionHandler = {};
 
-  ah['console_log'] = [function(data) {
+  ah['console_log'] = [function ahConsoleLog(data) {
       console.log.apply(console, data);
   }];
-  ah['console_error'] = [function(data) {
+  ah['console_error'] = [function ahConsoleError(data) {
       console.error.apply(console, data);
   }];
 
-  comObj.onmessage = function(event) {
+  comObj.onmessage = function messageHandlerComObjOnMessage(event) {
     var data = event.data;
     if (data.action in ah) {
       var action = ah[data.action];
@@ -27,15 +27,15 @@ function MessageHandler(name, comObj) {
 }
 
 MessageHandler.prototype = {
-  on: function(actionName, handler, scope) {
+  on: function messageHandlerOn(actionName, handler, scope) {
     var ah = this.actionHandler;
     if (ah[actionName]) {
-      throw "There is already an actionName called '" + actionName + "'";
+      throw 'There is already an actionName called "' + actionName + '"';
     }
     ah[actionName] = [handler, scope];
   },
 
-  send: function(actionName, data) {
+  send: function messageHandlerSend(actionName, data) {
     this.comObj.postMessage({
       action: actionName,
       data: data
@@ -44,16 +44,16 @@ MessageHandler.prototype = {
 };
 
 var WorkerProcessorHandler = {
-  setup: function(handler) {
+  setup: function wphSetup(handler) {
     var pdfDoc = null;
 
-    handler.on('doc', function(data) {
+    handler.on('doc', function wphSetupDoc(data) {
       // Create only the model of the PDFDoc, which is enough for
       // processing the content of the pdf.
       pdfDoc = new PDFDocModel(new Stream(data));
     });
 
-    handler.on('page_request', function(pageNum) {
+    handler.on('page_request', function wphSetupPageRequest(pageNum) {
       pageNum = parseInt(pageNum);
 
       var page = pdfDoc.getPage(pageNum);
@@ -89,7 +89,7 @@ var WorkerProcessorHandler = {
       });
     }, this);
 
-    handler.on('font', function(data) {
+    handler.on('font', function wphSetupFont(data) {
       var objId = data[0];
       var name = data[1];
       var file = data[2];
@@ -122,11 +122,11 @@ var WorkerProcessorHandler = {
       var obj = new Font(font.name, font.file, font.properties);
 
       var str = '';
-      var data = obj.data;
-      if (data) {
-        var length = data.length;
-        for (var j = 0; j < length; j++)
-          str += String.fromCharCode(data[j]);
+      var objData = obj.data;
+      if (objData) {
+        var length = objData.length;
+        for (var j = 0; j < length; ++j)
+          str += String.fromCharCode(objData[j]);
       }
 
       obj.str = str;
@@ -159,11 +159,11 @@ var workerConsole = {
     });
   },
 
-  time: function(name) {
+  time: function time(name) {
     consoleTimer[name] = Date.now();
   },
 
-  timeEnd: function(name) {
+  timeEnd: function timeEnd(name) {
     var time = consoleTimer[name];
     if (time == null) {
       throw 'Unkown timer name ' + name;
@@ -180,3 +180,4 @@ if (typeof window === 'undefined') {
   var handler = new MessageHandler('worker_processor', globalScope);
   WorkerProcessorHandler.setup(handler);
 }
+
diff --git a/src/worker_loader.js b/src/worker_loader.js
index f3646e530..fb37ca9c4 100644
--- a/src/worker_loader.js
+++ b/src/worker_loader.js
@@ -21,3 +21,4 @@ importScripts('../src/parser.js');
 importScripts('../src/pattern.js');
 importScripts('../src/stream.js');
 importScripts('../src/worker.js');
+
diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore
index e7eb0da43..443cb155a 100644
--- a/test/pdfs/.gitignore
+++ b/test/pdfs/.gitignore
@@ -12,4 +12,6 @@
 !rotation.pdf
 !simpletype3font.pdf
 !sizes.pdf
+!close-path-bug.pdf
+!alphatrans.pdf
 
diff --git a/test/pdfs/alphatrans.pdf b/test/pdfs/alphatrans.pdf
new file mode 100644
index 000000000..6274ce3ac
Binary files /dev/null and b/test/pdfs/alphatrans.pdf differ
diff --git a/test/pdfs/close-path-bug.pdf b/test/pdfs/close-path-bug.pdf
new file mode 100644
index 000000000..994d4e572
--- /dev/null
+++ b/test/pdfs/close-path-bug.pdf
@@ -0,0 +1,69 @@
+%PDF-1.4
+1 0 obj
+  <</Type /Catalog/Outlines 2 0 R/Pages 3 0 R>>
+endobj
+
+2 0 obj
+  <</Type /Outlines/Count 0>>
+endobj
+
+3 0 obj
+  <</Type /Pages/Kids [4 0 R]/Count 1>>
+endobj
+
+4 0 obj
+  <</Type /Page/Parent 3 0 R/MediaBox [0 0 612 792]/Contents 5 0 R/Resources << /ProcSet 6 0 R >>>>
+endobj
+
+5 0 obj
+  << /Length 885 >>
+stream
+   % Draw a black line segment, using the default line width.
+   150 250 m
+   150 350 l
+   S
+   
+   % Draw a thicker, dashed line segment.
+   4 w                                        % Set line width to 4 points
+   [4 6] 0 d                                  % Set dash pattern to 4 units on, 6 units off
+   150 250 m
+   400 250 l
+   S
+   
+   [] 0 d                                     % Reset dash pattern to a solid line
+   1 w                                        % Reset line width to 1 unit
+   
+   % Draw a rectangle with a 1−unit red border, filled with light blue.
+   1.0 0.0 0.0 RG                             % Red for stroke color
+   0.5 0.75 1.0 rg                            % Light blue for fill color
+   200 300 50 75 re
+   B
+   
+   % Draw a curve filled with gray and with a colored border.
+   0.5 0.1 0.2 RG
+   0.7 g
+   300 300 m
+   300 400 400 400 400 300 c
+   b
+endstream
+endobj
+
+6 0 obj
+  [/PDF]
+endobj
+
+xref
+0 7
+0000000000 65535 f
+0000000009 00000 n
+0000000074 00000 n
+0000000120 00000 n
+0000000179 00000 n
+0000000300 00000 n
+0000001532 00000 n
+
+trailer
+  <</Size 7/Root 1 0 R>>
+startxref
+1556
+%%EOF
diff --git a/test/test_manifest.json b/test/test_manifest.json
index d7ac34cef..25f609e8d 100644
--- a/test/test_manifest.json
+++ b/test/test_manifest.json
@@ -217,5 +217,16 @@
        "link": false,
        "rounds": 1,
        "type": "eq"
+    },
+    {  "id": "close-path-bug",
+       "file": "pdfs/close-path-bug.pdf",
+       "rounds": 1,
+       "type": "eq"
+    },
+    {  "id": "alphatrans",
+       "file": "pdfs/alphatrans.pdf",
+       "link": false,
+       "rounds": 1,
+       "type": "eq"
     }
 ]
diff --git a/web/compatibility.js b/web/compatibility.js
index ad4c8f8a9..7d1d72553 100644
--- a/web/compatibility.js
+++ b/web/compatibility.js
@@ -83,6 +83,21 @@
   };
 })();
 
+// Object.keys() ?
+(function checkObjectKeysCompatibility() {
+  if (typeof Object.keys !== 'undefined')
+    return;
+
+  Object.keys = function objectKeys(obj) {
+    var result = [];
+    for (var i in obj) {
+      if (obj.hasOwnProperty(i))
+        result.push(i);
+    }
+    return result;
+  };
+})();
+
 // No XMLHttpRequest.response ?
 (function checkXMLHttpRequestResponseCompatibility() {
   var xhrPrototype = XMLHttpRequest.prototype;
diff --git a/web/index.html.template b/web/index.html.template
index 12e606371..44e9a0cbe 100644
--- a/web/index.html.template
+++ b/web/index.html.template
@@ -3,7 +3,7 @@
 <head>
   <meta charset='utf-8'>
 
-  <title>andreasgal/pdf.js @ GitHub</title>
+  <title>mozilla/pdf.js @ GitHub</title>
 
   <style type="text/css">
     body {
@@ -31,18 +31,18 @@
 </head>
 
 <body>
-  <a href="http://github.com/andreasgal/pdf.js"><img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
+  <a href="http://github.com/mozilla/pdf.js"><img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
 
   <div id="container">
 
     <div class="download">
-      <a href="http://github.com/andreasgal/pdf.js/zipball/master">
+      <a href="http://github.com/mozilla/pdf.js/zipball/master">
         <img border="0" width="90" src="http://github.com/images/modules/download/zip.png"></a>
-      <a href="http://github.com/andreasgal/pdf.js/tarball/master">
+      <a href="http://github.com/mozilla/pdf.js/tarball/master">
         <img border="0" width="90" src="http://github.com/images/modules/download/tar.png"></a>
     </div>
 
-    <h1><a href="http://github.com/andreasgal/pdf.js">pdf.js</a>
+    <h1><a href="http://github.com/mozilla/pdf.js">pdf.js</a>
       <span class="small">by <a href="http://github.com/andreasgal">andreasgal</a></span></h1>
 
     <div class="description">
@@ -69,16 +69,16 @@
     <h2>Download</h2>
     <p>
       You can download this project in either
-      <a href="http://github.com/andreasgal/pdf.js/zipball/master">zip</a> or
-      <a href="http://github.com/andreasgal/pdf.js/tarball/master">tar</a> formats.
+      <a href="http://github.com/mozilla/pdf.js/zipball/master">zip</a> or
+      <a href="http://github.com/mozilla/pdf.js/tarball/master">tar</a> formats.
     </p>
     <p>You can also clone the project with <a href="http://git-scm.com">Git</a>
       by running:
-      <pre>$ git clone git://github.com/andreasgal/pdf.js</pre>
+      <pre>$ git clone git://github.com/mozilla/pdf.js</pre>
     </p>
 
     <div class="footer">
-      get the source code on GitHub : <a href="http://github.com/andreasgal/pdf.js">andreasgal/pdf.js</a>
+      get the source code on GitHub : <a href="http://github.com/mozilla/pdf.js">mozilla/pdf.js</a>
     </div>
 
   </div>
diff --git a/web/viewer.html b/web/viewer.html
index f7a5378ed..0c6ab385e 100644
--- a/web/viewer.html
+++ b/web/viewer.html
@@ -3,6 +3,7 @@
     <head>
         <title>Simple pdf.js page viewer</title>
         <link rel="stylesheet" href="viewer.css"/>
+        <script type="text/javascript" src="compatibility.js"></script>
         
         <!-- PDFJSSCRIPT_INCLUDE_BUILD -->
         
@@ -25,7 +26,6 @@
         <script type="text/javascript" src="../src/stream.js"></script>  <!-- PDFJSSCRIPT_REMOVE -->
         <script type="text/javascript" src="../src/worker.js"></script>  <!-- PDFJSSCRIPT_REMOVE -->
 
-        <script type="text/javascript" src="compatibility.js"></script>
         <script type="text/javascript" src="viewer.js"></script>
   </head>