Fix PL/tcl support for Event triggers, as per Peter E.'s review.
Fix PL/perl support for Event triggers, as per Peter E.'s review.
Fix some warnings found by Jenkins in -O0.