Fix incorrect index in the bash autocompletion script

refs #7246
Improve error messages for apply rules

refs #6070