Added code to set the weights of channels near the chunk edges to 0.
As far as I know, everything works in this version.