refTyp substring fix

The substrin was not called on the proper string. Using the #/definitions as ref was not working in all the cases
Merge pull request #162 from mpoiriert/patch-3

refTyp substring fix