Catch warning on NaN with nan_handling set to warn
Make lambdas ivars and initialize so they can reference other ivars