Fix for end marker

Basically, split out the boolean condition into 2. 
Where isNumber was in use before, this has been replaced by isNumberOrMarker (i.e like for like).

Then added a check to ensure we don't append a REF_PREF_DELIM, but instead append a Range separator