Some more code for animation handling.