Fix digest updating when data has zero length.