Fixed a bug in "remove-command" that could result in corruption of the device command cache