Make URI.search work with objects that have a toString method.