Add some checks
Parse cmdargs