Correct several bugs in the demonstrator and the idle behavior