more prolog bugfixes