Fixed broken resizing/orientation changes