fix some bugs with custom joints

there is still a bug with the joint limit in the 6DOF joint