Fix issues with resizing