Fixes logging to file.