Add guard against multiple cap_terminates and unnecessary cap messages.