Chaged the order in which we are closing the ROOT file.
Chaged a wrtie command to a flush command.
Merge pull request #49 from pcbend/master

Attempting to fix the seg fault on exit that sometimes appears.