fix bad initialialization of context manager fields