Fixed the way animations are cleared.