Fixed bugs in animation.