Ensure that do() on empty data frame returns consistent types.

Closes #625