Fixed various crash bugs by locking app in portrait mode.