better error messages, whitespace cleanup, imports cleanup
Merge pull request #438 from goodfeli/master

better error messages, whitespace cleanup, imports cleanup