Fix issues due to operator precedence and implicit type casts.