merge some minor changes from the theme branch
New theme system