Fix for minor bugs reported by randy-waterhouse.

Signed-off-by: FellowTraveler <F3llowTraveler@gmail.com>