Add additional checks to avoid effects of [bug 4850 (#4850)]. Rev: server/etc/modules/Variable.pmod/module.pmod:1.114