General way to read scan args as was before refactoring
The args from arg box has to be read in general way, not hardcoded with reading always 3 parameters. For example grid scan is taking 4 args. The errors were introduced by refactoring with !339 (merged).