Corrected getmrca function