Fixed bugs with animation