Fixed bug in table handling