Fixes func, eval errors, improves error handling