Fixing typos; fixing bulk queries.

Also deleting some useless imports to completely satisfy pyflakes.

Seriously, what the fuck is up with this library? I guess I'll have to write a
pile of tests because I have no idea what other stuff is subtly completely
broken.