Changed to a portable stdin flush tactic