change some asserts to casadi_assert