Add check for no time periods being defined, and make sure determineThemeAndScheme always returns a tuple