fixes to mechanism that adds parens to the last argument before the function chaining. Added test.