Bugfixed unwrap function (incorrect context manager)