As programs have gotten more sophisticated and integrated into our society, bugs have become a significant concern. To avoid this, we put a lot of trust in the metaprograms we use to analyze and compile them; however, these metaprograms might also contain bugs. The problem when reporting bugs in metaprograms is that they take programs as inputs: the bug might equally well be in the input program as in the metaprogram. In this dissertation, we show that modeling the input programs' validity improves our ability to verify and reduce bug reports that target metaprograms.