Fix a couple more bugs with bans. Logs were checking for the target in
the query instead of the ID, and a fatal error when requesting an
account using a banned IP, Email, or name.
Merge branch 'upstream' into new-closes
Fix stuff that stwalkerster pointed out in the pull request, and a
couple other things I noticed.