Fix 'Args out of range' issue

'substring' is failed if user short prompt string by deleting
default input.