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

Thanks rpbalow for suggestion, loic, akaariai, and jorgecarleitao for review.