Fixed removeAllCommands() bug that caused some commands not to be removed in certain usage scenarios.