I tightened up the tolerances of the ODE solver which has seemingly fixed the issue. Thanks everyone for the help.