Replaced incorrect length(args>0) with !isempty(args)