Fix flicker issue reported in issue #1