Implemented avoidance of surfaces.