bugs in table generation