Fix a bug with the logfiles not getting cleared.