fix regression in reaction ordering, and sanitise order and sort parameters.