Fixed bug relating to resize