Trigger fixes

Here are three trigger-related fixes.

First one deals with debug mode segfaults when sending most of the triggers.
Next one fixes module trigger sending.
And the last one assigns proper module names in module triggers.