rts fixes, stdout flushing support