fix a few issues in rules