fix bugs with return solutions in rules