Fix button repaint on error (bug 840117)