Fix box resizing