tm: properly initialize context buffers