Minor code cleanup in various places.
Merge pull request #85 from ernstchan/minor-changes

Minor code cleanup in various places.