Fixed errer when $msg and/or $ruleId is not defined - refs: #12