Fixed some bug from reduce_t and test