Fixed bug in rule invocation