a few fixes regarding TOSTDOUT