Merge pull request #85 from josharian/varia

Assorted optimizations