Fix missing import and use unbuffered IO