fix final chunk exclusion bug. improve debug and normal output.