Fix bugs in animation.