Fixed StringIndexOutOfBoundsException