Fix expression precedence and associated tests