Fixed lack of recursion in insertTokens