Added cleanup code around tests so that StepScope registration was
cleaned up.