Fixes some scope issues with the log file var