Remove typecasts in TEST and TEST_END