Indentation fix
Remove an unused import
Deduplicate code in the command class

Setting various attributes was handled twice, depending on how the class
was called. This also meant that in same cases the argument check was
not executed.