Fix count=0 case, and fix file length problem.