I wouldnt call it a problem
it does say N is a manditory parameter and $null != 0 , so it not returning anything is expected.

i do however think
%cmd = $iif($3,$3-,echo -a)
should be
%cmd = $iif($2,$2-,echo -a)

if the syntax is <N> [command]


$maybe