Fix some remaining bugs with orientation change