Check the number of arguments to avoid startup errors from the shell

Change-Id: I04dc8307bc91b48e00c6fd7250fbce502167331e