Fixed the variable removal when switching the timestep