Fixed GetHalfPeriod bug caused by incorrect array chomping