Dgoodwin/rules cleanup

Several fixes reported by James Slagle. Details in each commit.