Add @trustin's comments and also test that the context is flushed