First stab
Fixes a problem with rules getting clobbered