Fixes #1 where reordering would fail on an empty table.