Aren't you modifying one extra bone?
You count from 0 to boneCount, which is boneCount+1...

Also, it still looks ugly with ragdolls, but I'm not sure what do about it. entity:SetModelScale does it properly, but it only works with scalars :/
(And E2 has the same problem)