Fix variables which leak into the global context.

The `expressionCode` and `failedIndex` variables should not be global.
Merge pull request #1 from cscott/leak-fix

Fix variables which leak into the global context.