Minor optimizations
Merge pull request #4 from d10/master

Minor optimizations.