logger: bugfixes + code clean up