fixed handling of empty command lines and nonexistent input