Fix function order to respect command order.