Fixed writing to stdout.