Add macro-enabled debugging to joint_order.