Fix bug with duplicating log messages to output