Corrected string index out of range (JENKINS-25466)

https://issues.jenkins-ci.org/browse/JENKINS-25466
Merge pull request #3 from magjac/master

Corrected string index out of range (JENKINS-25466)