Avoids usefulFact recursion with nil parameter. Fixes #518.
Merge pull request #519 from gradha/pr_guards_against_nil_ast

Avoids usefulFact recursion with nil parameter. Fixes #518.