Fix ArrayIndexOutOfBoundsException on empty string