Fix reverse_order bug