fix handling of named anonymous functions