The Gemara in Nedarim [87a] says:
והתניא אמרו לו מת אביו וקרע ואחר כך נמצא בנו לא יצא ידי קריעה אמרו לו מת לו מת וכסבור אביו הוא וקרע ואחר כך נמצא בנו יצא ידי קריעה
And it is taught similarly in the following braisa: If they said to him that his father had died and he rent his garment over his death, and afterward it was discovered that it was not his father who died, but his son, he has not fulfilled his obligation of rending his garment. If, however, they said to him that a relative of his had died, and he thought it was his father and he rent his garment over his death, and afterward it was discovered that it was not his father who died, but his son, he has fulfilled his obligation of rending his garment.
We see from this that when a person does an act out of doubt then he takes all possibilities onto account. In the words of the Rogochover:
דכל היכא דחזינן דאין הדבר ברור לו ומ"מ עשה, נחית לספק ולא קפיד.