Fixes error catching, braces and brackets in lambdas