arming: fixed logic bugs with arming.