Cleanup cmd on entrypoint setting

Fixes #5147
Maybe you're right. I thought that there is other test for testing this.