Fixes issue #587. Apparently, self.interfaceOrientation is unreliable.