Fix handling of trailing '*' in history numbers