Fixed some bugs with npcs