Results from a quick code review

Hello,

I have the habit of doing a quick code review before running code pulled from github, and I came up with three patches for you.

"Do not iterate with dir..." is slightly cleaner code and a little performance improvement.

"Added missing import" fixes a traceback in an unlikely case

The other's just a typo I spotted in comments.