Fixes to rules template directory handling
 Please enter the commit message for your changes. Lines starting