Minor bug fixes.

Stumbled upon a few variable errors.