Fix for button flicker, closes #796