Fix creating an animation loop from an array