Cleanup the core test function