Prevent string index out of range error when initializing the validator

This resolves https://issues.jboss.org/browse/JBCTS-1347