Added some E17 fixes for theme detection.