Fix bug in local variable handling
Add missing require in case it is not autoloaded