Advanced Locomotion System V3

I got a custom mesh to move around using animation retargeting. I run into a problem where the character tilts through the ground when turning, and flips upside down when jumping. I checked the import axis directions, and they match the epic mannequin. Any idea what I’m doing wrong?