Cleanup cmd on entrypoint setting

Fixes #5147
ok, ic