prevent appending 'undefined' to unique tokens

It's a minor thing, but while debugging I was getting unique tokens like "11400767418683undefined" :)