Fix string length check in StringValidator.

Unit tests for validators are still missing.
No point in adding them now with a redesign imminent,
but we should really have them soon.

Change-Id: I92e2b7cb98203119455ec91bfb5096a06dbe7fa1