ensure growing the table if necessary + minor optimizations and cleanings

a recently introduced bug was preventing the table from being grown past its initial size