reduced code size a bit
added a traceback to the logfile when an exception occured