Fixing kgtp.py