Fixed a small issue with the prolog term grammar