I've added six new error checking clauses, and tried to be as descriptive as possible about what is wrong, or missing. I made a few minor tweaks and adjustments, but don't believe any of them trigger the errors being seen.
For additional feedback please provide the exact command string you're entering, and whether you had something on your cursor or not when you get the gremlin message. That message indicates there's a condition people are using that I have totally overlooked, and I cannot replicate it, as I cannot trigger it with any of the testing I've done in the past 24 hours.