Fixes to get compiling, and rule changes