See if printing to stderr solves the issue.