Fix auth cancellation patch

Check command input buffer instead of the last command argument.
Fix next argument index value.
Merge pull request #19 from santa01/fix_auth_input

Fix auth cancellation patch