Parse token if it's an string (keep a compatible API). Refs #180