Bugs with output on Windows fixed