Changed some SQL logic in ThemePersistence related to getting mapped themes.