Added some stdout flushing to make ssh/subprocess communicate work better