Made GUI repaint after switching windows

Fixes #23 and #19