Add handling of empty tables