Fix bug with checking rules with free variables