Improve NPC validation check