Added missing case in closure handling

- Also restructured function body compilation