simplify get-instance-name when word-index is string

Doesn't need those codes when word-index is a string.