Fix indices of generalized coordinates in balance app