#35 no nullpointers when an agent is freed that does not have entities
attached.