Fixed NPEs in ProcessLibraryCommand 

Added setType() method.
Added check for null arguments before adding them to command list.