Better stdout handing, fixes #10