fixes for rule events and variable errors