Fix variable scope
Fix Plug mappings
Fix url references