fix bugs for table initialization: attrnum should start from 1 instead of 0