Assorted tweaks.

Tightened up the code slightly without changing or adding any functionality.