Moved the file renaming to after the streams are closed.  Populated the
default values for some parameters to truly make them optional.