Fixed redirection, and getTokens.

getTokens returns length of array.

This fixes the issue that redirection was dealing with.