Fixes #5816: AgentType is now correctly initialized

And does not throw NullPointerException anymore