Add missing tests for basic Prolog constructs + fix few cases.