In this macro, what would cause the error "Type Error: Cannot read property 'substring' of undefined". This happens when I select a token and then run the following macro to do a cure spell. &{template:pf_spell}{{header_image=@{header_image-pf_spell}}}{{character_name=@{selected|character_name}}}{{character_id=@{selected|character_id}}}{{name=?{Cure Spell|Cure Light,Cure Light Wounds }} {{@{target|character_name} Heals =[[ floor(1.5*(1d8+{5, @{selected|spellclass-0-level-total}}kl1)) ]] HP }} {{Undead: Will Save DC [[ 10 + 1 + [[ @{selected|WIS-mod} ]]]]- Half Damage}}|Cure Moderate, Cure Moderate Wounds}} {{@{target|character_name} Heals =[[ floor(1.5*(2d8+{5, @{selected|spellclass-0-level-total}}kl1)) ]] HP }} {{Undead: Will Save DC [[10 + 2 + [[ @{selected|WIS-mod} ]]]]- Half Damage}}|Cure Serious, Cure Serious Wounds}} {{@{target|character_name} Heals =[[ floor(1.5*(3d8+{5, @{selected|spellclass-0-level-total}}kl1)) ]] HP }} {{Undead: Will Save DC [[10 + 3 + [[ @{selected|WIS-mod} ]]]]- Half Damage}}|Cure Critical, Cure Critical Wounds}} {{@{target|character_name} Heals =[[ floor(1.5*(4d8+{5, @{selected|spellclass-0-level-total}}kl1)) ]] HP }} {{Undead: Will Save DC [[10 + 4 + [[ @{selected|WIS-mod} ]]]]- Half Damage}}|Cure Light Mass,Cure Light Wounds Mass }}{{Range: [[25 + (5*floor(0.5*@{selected|spellclass-0-level-total})) ]]ft}} {{Target[[@{selected|spellclass-0-level-total}]]: no two of which can be 30ft apart }}{{ Heals =[[ floor(1.5*(2d8+{25, @{selected|spellclass-0-level-total}}kl1)) ]] HP }} {{Undead: Will Save DC [[10 + 5 + [[ @{selected|WIS-mod} ]]]]- Half Damage}} |Wand of Cure Light,Use his Wand of Cure Light Wounds}} {{ @{target|character_name} Heals =[[1d8+5]] HP } }}