Serial_num buffer bug fix