Fixing bug of kgtp.py