Fix bugs in theme selection

TBR: minor and obvious fixes