Renames context to environment and fixes a test.