fixed a few bugs in robot avoidance