Fixed rotation crashes

Change-Id: I6e0b3963cca27eda4303ebe1b8a361ca799bdbfd