I am looking at flocking properties in MASON's Flockers implementation

I am interested in Flocking in a bounded, or Non-Toroidal, space.  I coded
a wall avoidance vector that, once within an agents' neighborhood, repulses
with the square inverse of the distance to the wall.  This negatively
impacts flocking - there tend to be more, smaller flocks, and more agents
not apart of a flock, because flocks break up when they hit the wall

Are there other ways to implement a bounded area, or wall avoidance?  Ways
that reduce fragmentation or don't effect flocking?

Are Flockers and related BOIDS typically implemented in toroidal space for
this very reason?

Thanks, Ryan