The idea is indeed to optimize the rules first, then reset the RULES flag and optimize the parameters. But this is not yet implemented, so at the moment you can not optimize parameters after rules, only the other way around. I've put that on my list to implement.