Fixed #14334 -- Query comparision now check for object types.

I would separate each `with` statement with a line break. right now it looks like a huge block of stuff.