Small fixes to prolog rules, tests, and examples