Added more validation of the logic tree