Added exceptions to context and accompanying tests.