Restored original method of checking for n = 1.
bugfix: forgot that new[] does not initialize memory.  :\
bugfix: don't run minmax_element unless n > 0.
Counting sanity madness!  :)