Syncing output when running in foreground.
Merge pull request #121 from jjoos/master

Syncing output when running in foreground.