Fix processing of neighbourhood that was broken in the previous commit
Remove a number of corner cases