Made some changes to the logger, hopefully fixing the 'unlink-problem'.