Cleaned out handful of not used globals and added exception handler for dealing with problems when switching log file output port