Data is stored in a RAM page buffer, which is only written to FLASH when it is full. If the instrument is powered off, samples stored in the partially filled page buffer will be lost BUT the recorded sample number will still be the same. This means that when all samples are uploaded, the last few will be unreliable. The page buffer is 256 bytes. If a sample is 17 bytes then up to 15 samples at the end could be lost.
Our suggestion for how to avoid this problem is that if you want every sample, upload data without power cycling the instrument. Otherwise, plan to log samples for N more than you want to acquire, where N is based on the number of samples required to fill the page buffer.
There are other potential causes, but this is more probable. If this method does not resolve your issue, please contact Technical Support.