Cleanup cmd on entrypoint setting

Fixes #5147
ew!