Fix activities order.
Minor performance fix.