Fix a bug with commands history.