Fix for preserving rule document order.