Add aftereach debug to tests