Fixed a few bugs.

Signed-off-by: Paul Buonopane <paul+git@earth2me.com>