Fix for the twitching behaviour described by issue #128.

Fixes a twitching behaviour that sometimes occurs when opening/closing the pane (see issue #128).