Fix stupid bug parsing the cmdline spec that meant we always hit the WS.

Also add better error reporting for connection errors.