Fixed flickering issue with some effects.

Fixes #9