Fixed logging to a file since it didn't work anymore.