Bugfix: Avoiding flickering in animation

I belive this fixes #1