Fixed token comparison code