added better query support
Merge remote-tracking branch 'upstream/master' into allow_@_in_username