Fix bug with inherited stdio