fix cs_order and cs_primitive bugs