changed macro to ignore empty trees and made compiler do the substitution work