Various improvements to the command

Each commit compiles and works correctly, so you can drop those you don't appreciate.