FBX skeleton collapses when animation is applied

I’m trying to import a custom skeleton and mesh from Maya into UE4, but for some reason the legs on this creature do not want to stick out as they should. That is, when I check the placement of the joints that have imported, some of the leg joints seem to be stacked on top of each other. The mesh comes into UE4 in its proper T-pose just fine. It’s when I apply the animation that it messes up. Please help? It seems to only effect joints with IK handles on them.