InsertTable(index, x, y) was calling itself recursively instead of calling its base implementation which caused a stackoverflow.