Minimize the scope of the temp buffer.
Merge pull request #22 from mdorman/scoping

Minimize the scope of the temp buffer.