Parser fix cmd null

Fixes #8136
Closes #8136

Included test as well. PTAL @tianon @tiborvass @crosbymichael 

I left the explicit nil in there to communicate to readers that this is a thing that is necessary.