Fix bug in thm