Fixes calculation of checked/in out in theme function.