The majority of scholars are of the view that the maximum length of nifaas is forty days; if the bleeding lasts any longer than that, then it is istihaadah (irregular bleeding) unless it happens at the usual time of menses, in which case it is menses.
See the answer to question no. 10488.
Based on this, if you saw blood after forty days and it coincided with the usual time of your period, then it is menses. As for yellowish discharge, it does not mean anything, because Umm ‘Atiyyah (may Allaah be pleased with her) said: “We did not regard yellowish and brownish discharge after tuhr (becoming pure) as being of any significance.” Narrated by Abu Dawood (307) and classed as saheeh by al-Albaani in Saheeh Abu Dawood.
You did right to continue praying and make up the fast you owed. May Allaah increase you in knowledge and guidance.
And Allaah knows best.