corrected some important bugs introduced in termbase creation