Improve command input error handling