Fix select when table is empty
extensive property testing