TestCase cleaning and fixed some of the broken functionality