Improve on some non blocking IO issues, still working on output corruption in the test case