1.Kuja knows how to teleport. He used all his remaining energies to teleport Zidane and co. out of the IIfa Tree before teleporting himself. But instead, he got off the wrong place and ended up falling back into the roots of the IIfa Tree.

2. Same theory as above. Only I think Kuja sacrificed himself to teleport Zidane out of danger.