Add tests for other token types, fix minor bugs