Added a few lines to try and ensure resetting of the robot.