Fixes a small delay when switching from one animation to another.