Bugfix, animation to keep track of number of values

Animation to keep track of number of values that are animated, otherwise
the count may be wrong when animation is reused.