Fix token generation on serializer