Corrected bug in words2Packets function.