Fix bugs of change_partition_axis and add a test