Fixes an issue where logging during collection step caused duplication of log messages to stderr.