Agent: UUID generation and agent registering fixes