Fix bugs in table filling, q4