Improve switch mode between walk and put flag

Edited by Benoît Harrault