miscellaneous tweaks from aringlis.
manual merge-in of master.
merging with master
Merge pull request #154 from aringlis/misc_fixes

Miscellaneous tweaks from aringlis.