fixes and add rule test