Added a fix to prevent the completion callback from firing multiple times in Firefox on OSX (fixed bug #1406).