Added safechecks for missing arguments