update rules JS, fixed tests