fix that invalid capture in do-end block causes SEGV
fix SEGV on invalid lambda invocation