Fixed bug when sending last packet of data smaller than the receiver window size