Fix resizing on OS X, fixes issue #23