     modifyTargetIdForUniqueness: (target) ->
         slide_id = @slide_div.attr('id')
         this_slide = @slide_div
-        
-        new_target = target.replace(/#/g,'') + '_' + slide_id
+
+        target_id = target.replace(/#/g,'')
+
+        # t = $(target, this_slide)
+        t = this_slide.find(target)
+        console.log(t)
+        
+        new_target = target_id + '_' + slide_id
         new_target_sel = '#' + new_target
         
+        if t == undefined or t == null or t.length == 0
+            # try to route around bugs in JQuery selection into SVGs
+            t = exhaustiveSearchByID($('svg', this_slide).get(0), target_id)
+        
+        if t == undefined or t == null or t.length == 0
+            # if we still couldn't find an appropriate match, just pass back the original
+            # target selector, unmodified
+            console.log('Could not find element matching target: ' + target)
+            return target
+            
+        console.log(t)
         console.log('modifying ' + target + ' to ' + new_target)
-        $(target, this_slide).attr('id', new_target)
+
+        t.attr('id', new_target)
+        console.log('now: ' + t.attr('id') + ', ' + t)
         
         return new_target_sel
 

                    if $(target) is null
                        alert("Invalid target #{target} in build #{subbstr}")
                    
                    #target = slide.modifyTargetIdForUniqueness(target)
                    
                    build_obj = build_types[type](@slide_div, target, args...)


                #$.get(path, success, error)
        
        
        # $('g').each (i) ->
        #             op = $(this).css('opacity')
        #             console.log("opacity = #{op}")
        #             if $(this).css('opacity') == undefined
        #                 $(this).css('opacity', 1.0)
    
    
    # -----------------------------------------------------------------------
