Scopes must be defined in lambdas or procs.

[ fix #3071 ]