Using toString() for unknown classes when determining if they represent URI. #938