More bug fixing in TokenUtils