Fixed TreeCPD and RuleCPD issues