Fix bug with rule precedence