$ 0 0 *MERGE* Merge fixes from trunk into the empty-table-optimizations branch (tags: empty-table-optimizations)