Avoiding accumulation out-of-range entries in the histogram's first and last bins

HI,

Can you please post a running script so we can understand where the problem is coming from ?
I already answer in this related post