Fix javascript Error getTokenTypeAt. Issue #1