Fixed some issues with NPC creation/deletion and deserialization

Due to the fact that the userid field is optional