Some upgrades to CommandManager

It's propably not working.