Correctly handle nested tables