Fixed a NullReferenceException on startup.