I've noticed that it's not uncommon for the "alive" stat to remain above 0 even when only undead entities are on the screen. It looks like those that are unaccounted for on the screen (but appear in the "alive" count) have px/py and x/y property values of NaN when this occurs.