Fixes checks for missing template definitions and checks for unused variables that occurs inside lists.