Correct a few problems in the animation handling