String validation

And token trimming