Fixed a crash when displaying alerts.