fixed missing casts in controlled_runge_kutta, plus test case