Fixed the resizing functionality.