No need to track whether or not we wrote the header; checking the context is good enough.