Some fixups
Merge pull request #1 from bbangert/master

Some performance tweaks.