Thanks, I clearly messed up this one. It's better to have a loop in reader_flush() because it's the only place that needs to handle ALL flag.