Fix bugs with Contexts and Test base classes