Process rules in new order, fixed bugs