fix for issue #3047 (throws exception in case of non-comparable)
unit test for issue #3047 (throws exception in case of non-comparable)