Fix typo
Factor out expand_cmd()
Support optional argument-less parameters