Improve some range checks.
Move some checks out of parse_cmd().

It is not a good idea parse_cmd() to just die().
Increase outputs and inputs to 288.

The biggest Videohub seems to have 288 inputs/outputs.