Added setType() method
Fixed NPE for command with no arguements