context tests and fixes