Various null guards and theme fixes