Fixed bugs in tyc2lib; converted tyc2_test.c to use it; make test works