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

Thanks rpbalow for suggestion, loic and akaariai for review.