Improve token check.