Bug fixes for IK, tested