MFC r277229:
Use parentheses instead of close proximity to ensure layer + 1 is evaluated before the rest of the expression.