This looks a lot like a misformatted npc file. Try remaking the NPC without editing the file to see if it fixes the problem. If so, you can reattempt the edits.