Fix testing termination code