Added smarter macro processing (I think)