Fixing general errors. Major changes to AvoidWall logic