Cleanup cmd on entrypoint setting

Fixes #5147
I don't understand the change here, why did you change this?