How did you fix that?

And if I use the old libcod I can manually free the slot, then it's working. But with a script it's not working.