Fix pyflakes warnings.

This fixes a couple pyflake warnings. Only one (which I just introduced
and only happens in an unexpected error) were at all problematic.