Support for device rotation added.