testgen: added some TODO comments; fixed a bug