Some more small tweaks for speed.
Some more small speed related tweaks.
Fixing missing $. (Thanks Shish!)
Merge pull request #341 from jgen/master

More small tweaks