I installed into GNU coreutils the attached series of patches, to fix problems like 'shuf -n 0x' where shuf did not diagnose the trailing 'x', along with some other stuff I noticed while looking into the problem.