Remove the special case for empty dataframes.

Fixes issue #6062.