HHH-9075: fixed StringIndexOutOfBoundsException