Removed bug in logging-code