Expanded GetNeighborhoodWindow() to go out of bounds when necessary.