Update TKGen.class.php

Small bug fixed