Fixed two bugs, currently bug free

Bug #1 was needing to unbind the animationend events, and #2 was
0-index vs 1-index calculation error