Fix resizing bug in OS X