Increase test coverage, and modify handleEnd behavior to only see correct tokens.