Pops all ai states on entity deletion. Hopefully fixes Issue #164.