I have not fully analyzed the BricsCAD fence bug, but the order of the selection set determines the numbering. You can verify this by using various combinations of single picks and selection windows when you use the the c:NumSet function.
For a selection window it is the draworder that determines the order of the selection set, but when not changed by the user the draworder is the same as the database order (the last or top element is selected first).