Flush stdout to avoid erroneous error message

Fixes #68, verified this on python2.7 and python3.3.
Merge branch 'issue68' into develop

* issue68:
  Flush stdout to avoid erroneous error message