Attempt at fixing buffering and some fixes to robot.py