I did some rewriting of the Gate spell. There's always the risk that players may want to summon up hostiles. I made it so whoever casts the Gate spell is responsible for whatever the summon does. In other words, if the caster gets a hostile summon because the caster didn't have Protection from Evil, the summoned demon will attack any nearby creature. However, the caster is held responsible. For example, if the demon murders an NPC, the caster is sent immediately to prison.
Please test the script and note any issues. Thanks!