Fixed issue where logfile could not be created