With this change the theme check happens at activation time. An integration test is also added to verify the functionality. Fixes #5110