minor fixes in rules engine