Fixed bug in genKAT.c