Fixing the bug inside kgtp.py