Fix some static analysis problems in animation.js