[DROOLS-600] fix ClassCastException when using FactTemplates