Fix associativity at equal precedence (#3927)