Fix bugs in theme check