Code & minor bug cleanup.

Cleaned up redundant code (and a typo missed earlier).