Fix: Some bugs relative to the lcmdlc2 machine and to the setEnvironment function