FIX: Get-term-variables function.

Due to the renaming and recreating some of the Prolog Objects, the function was not working properly.