Fixed indexing bug.
Added tests for two ribs with multiple joints.