Issue #1761: Shoddy attempt to fix the first case. The usual error handling doesn't work because the error is on tree of the local class, not the function.
Issue #1761: Enable tests