why the finger getting folded
The problem lies in a misalignment between the deforming bones and the mesh, so you will have to adapt them one to another (actually, it seems to me far more easy to modify the mesh than this complicated rig).