Fixed series insertion to output

The previous logic for inserting series numbers to output file names
caused an off-by-one error where the last series was not written.

Fixed by checking to see if more than 1 series to be processed, and if
so the series number is inserted before the first '.', which should also
cause output files to sort more favorably.