Fix bug dropping agent on invalid locations