Fix resizing.
Fixes issue #4.