Fixed problems with operator precedence