Thread-local caching fix, don't raise assert error when unique query returns more than one object.