Corrected resolution bug.  Added rule priority