Cursor.enumerate(): fix bug on empty cursors.