rules tests and fixes