Fixes in weighting and boundaries
