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

@jorgecarleitao 
"If not..." is a part of that check that is being talked about in the first line.