Flush input/output function were reversed on mac, fixing that.