In some cases you may need to change MMSCurrentMachineID and InstanceID on agent machine, e.g. when there are issues with agent registration.
This article explains how to do this.
Remove the Agent from Management Server and run a special script that will clear the local databases to avoid duplicates. After you re-add the machine to Management Server, Agent will obtain the new configuration data from it automatically.