Humanoid model bends incorrectly with bones.

Hello,
I am trying to create a custom avatar for VRChat, using Unity (v2017.4.28f1).
The problem I have in particular is how the model deforms in lieu of its rig pose. If I view the model in the Avatar Configuration environment, or if I attempt to move one of its bones in a scene, the model bends incorrectly.

All I want to know is if there are any telltale signs of a particular thing I need to fix in 3DS Max. To clarify, I’m not asking for help on actually fixing the model, but finding out the issue behind it.

If I can get a concise answer, I will be able to further elaborate the subject on Autodesk forums.

I have provided pictures of the problem:
Attached pictures


Model outside Unity’s Avatar Configuration and within a scene (default pose)

Model inside Unity’s Avatar Configuration interface (T-Pose)

Update: I think I fixed the problem myself. All I had to do was redo the model’s rigging in 3DS Max, replace the corrupt envelope with a new one, and map the weights.