Properly capture local functions

Local functions in local classed wasn't captured properly