Fixed a bug that resulted in moving data to random positions in table
when inserting new rows/columns.