Don't return 0 exit code on invalid command

Fixes #4780