Replaced old, buggy NSContext class with a new one written from scratch that actually complies with the specification.