Fixes file logging