Fix some inconsistencies between the agent and remote APIs.