Make the theme slug expansion more robust