Fix device orientation change on phones and tablets.