Better handling of flushing