Quantcast

full taintlog parse and clean stage 2

Munglunch [10-09-14 - 21:54]
full taintlog parse and clean stage 2
Filename
Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HyperCombo/oUF_HyperCombo.lua
Interface/AddOns/SVUI/packages/bag/tools/sorting.lua
Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua
Interface/AddOns/SVUI/packages/override/SVOverride.lua
Interface/AddOns/SVUI/packages/plates/SVPlate.lua
Interface/AddOns/SVUI/packages/stats/SVStats.lua
Interface/AddOns/SVUI/packages/stats/stats/experience.lua
Interface/AddOns/SVUI/packages/stats/stats/friends.lua
Interface/AddOns/SVUI/packages/stats/stats/guild.lua
Interface/AddOns/SVUI/packages/stats/stats/time.lua
Interface/AddOns/SVUI/packages/tip/SVTip.lua
Interface/AddOns/SVUI/packages/unit/SVUnit.lua
Interface/AddOns/SVUI/packages/unit/elements/auras.lua
Interface/AddOns/SVUI/packages/unit/elements/castbar.lua
Interface/AddOns/SVUI/packages/unit/elements/essentials.lua
Interface/AddOns/SVUI/packages/unit/elements/misc.lua
Interface/AddOns/SVUI/packages/unit/elements/tags.lua
Interface/AddOns/SVUI/packages/unit/frames.lua
Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua
Interface/AddOns/SVUI/packages/unit/resources/druid.lua
Interface/AddOns/SVUI/packages/unit/resources/mage.lua
Interface/AddOns/SVUI/packages/unit/resources/monk.lua
Interface/AddOns/SVUI/packages/unit/resources/paladin.lua
Interface/AddOns/SVUI/packages/unit/resources/priest.lua
Interface/AddOns/SVUI/packages/unit/resources/rogue.lua
Interface/AddOns/SVUI/packages/unit/resources/shaman.lua
Interface/AddOns/SVUI/packages/unit/resources/warlock.lua
Interface/AddOns/SVUI/scripts/questwatch.lua
Interface/AddOns/SVUI/setup/installer.lua
Interface/AddOns/SVUI/setup/presets.lua
Interface/AddOns/SVUI/system/alerts.lua
Interface/AddOns/SVUI/system/animate.lua
Interface/AddOns/SVUI/system/common.lua
Interface/AddOns/SVUI/system/mentalo.lua
Interface/AddOns/SVUI/system/moveable.lua
Interface/AddOns/SVUI/system/timers.lua
Interface/AddOns/SVUI/system/utilities.lua
Interface/AddOns/SVUI/system/visibility.lua
Interface/AddOns/SVUI_ChatOMatic/components/answering_service.lua
Interface/AddOns/SVUI_ChatOMatic/components/chat_history.lua
Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua
Interface/AddOns/SVUI_ConfigOMatic/components/bar.lua
Interface/AddOns/SVUI_ConfigOMatic/components/dock.lua
Interface/AddOns/SVUI_ConfigOMatic/components/filter.lua
Interface/AddOns/SVUI_ConfigOMatic/components/plate.lua
Interface/AddOns/SVUI_ConfigOMatic/components/profiles.lua
Interface/AddOns/SVUI_ConfigOMatic/components/units/raid.lua
Interface/AddOns/SVUI_CraftOMatic/components/cooking.lua
Interface/AddOns/SVUI_CraftOMatic/components/farming.lua
Interface/AddOns/SVUI_CraftOMatic/components/fishing.lua
Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua
Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua
Interface/AddOns/SVUI_StyleOMatic/components/addons/Ace3.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/achievement.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/alert.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/archeology.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/auctionhouse.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/barbershop.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/battlefield.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/blackmarket.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/calendar.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/challenges.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/character.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/chat.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/dressup.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/encounterjournal.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/friends.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/gossip.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/guild.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/help.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/inspect.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/itemsocketing.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/itemupgrade.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/keybinding.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lfd.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/loothistory.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lossofcontrol.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/macro.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/mailbox.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/merchant.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petbattle.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petition.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petjournal.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petstable.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/pvp.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/quest.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/raid.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/reforging.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/spellbook.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/store.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/system.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tabard.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/talents.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/taxi.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/timemanager.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/trade.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tradeskill.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/trainer.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/transmog.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/voidstorage.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldmap.lua
Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldstate.lua
Interface/AddOns/SVUI_TrackOMatic/components/unitframe_gps.lua
diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HyperCombo/oUF_HyperCombo.lua b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HyperCombo/oUF_HyperCombo.lua
index 3ee208e..efbd5fd 100644
--- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HyperCombo/oUF_HyperCombo.lua
+++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_HyperCombo/oUF_HyperCombo.lua
@@ -99,7 +99,7 @@ local Update = function(self, event, unit)
 			else
 				cpoints[i]:Hide()
 				if(bar.PointHide) then
-					bar.PointHide(cpoints[i])
+					bar.PointHide(cpoints[i], i)
 				end
 			end
 		end
diff --git a/Interface/AddOns/SVUI/packages/bag/tools/sorting.lua b/Interface/AddOns/SVUI/packages/bag/tools/sorting.lua
index b1dc03e..be4c4d4 100644
--- a/Interface/AddOns/SVUI/packages/bag/tools/sorting.lua
+++ b/Interface/AddOns/SVUI/packages/bag/tools/sorting.lua
@@ -20,10 +20,20 @@ LOCALIZED LUA FUNCTIONS
 ]]--
 --[[ GLOBALS ]]--
 local _G = _G;
-local unpack 	= _G.unpack;
-local select 	= _G.select;
-local pairs 	= _G.pairs;
-local ipairs 	= _G.ipairs;
+local unpack        = _G.unpack;
+local select        = _G.select;
+local assert        = _G.assert;
+local type          = _G.type;
+local error         = _G.error;
+local pcall         = _G.pcall;
+local print         = _G.print;
+local ipairs        = _G.ipairs;
+local pairs         = _G.pairs;
+local next          = _G.next;
+local rawset        = _G.rawset;
+local rawget        = _G.rawget;
+local tostring      = _G.tostring;
+local tonumber      = _G.tonumber;
 local tinsert 	= _G.tinsert;
 local string 	= _G.string;
 local math 		= _G.math;
@@ -293,6 +303,8 @@ BAG ITERATION METHOD
 ##########################################################
 ]]--
 do
+	local bagRole;
+
 	local function GetNumSortingSlots(bag, role)
 		if (bag > 50 and bag <= 58) then
 			if not role then role = "deposit" end
@@ -562,7 +574,7 @@ do
 		twipe(sourceUsed)
 	end

-	function MOD.Stack(bags)
+	function MOD.Stack(bags, canMove)
 		if not canMove then canMove = true end
 		for _, bag, slot in IterateBagsForSorting(bags, nil, "deposit") do
 			local bagSlot = (bag*100) + slot
@@ -717,6 +729,7 @@ do
 				end
 			end
 			if lockStop then
+				local i = 1;
 				for slot, itemID in pairs(moveTracker) do
 					local actualItemID = GetSortingItemID(floor(slot/100), slot % 100)
 					if actualItemID  ~= itemid then
@@ -744,6 +757,7 @@ do
 						return
 					end
 					moveTracker[slot] = nil
+					i = i + 1;
 				end
 			end
 			lastItemID, lockStop, lastDestination, lastMove = nil, nil, nil, nil
diff --git a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua
index eba7b36..f9bec86 100644
--- a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua
+++ b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua
@@ -13,6 +13,60 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+
+local _G = _G;
+--LUA
+local unpack        = _G.unpack;
+local select        = _G.select;
+local assert        = _G.assert;
+local type          = _G.type;
+local error         = _G.error;
+local pcall         = _G.pcall;
+local print         = _G.print;
+local ipairs        = _G.ipairs;
+local pairs         = _G.pairs;
+local next          = _G.next;
+local rawset        = _G.rawset;
+local rawget        = _G.rawget;
+local tostring      = _G.tostring;
+local tonumber      = _G.tonumber;
+local getmetatable  = _G.getmetatable;
+local setmetatable  = _G.setmetatable;
+--STRING
+local string        = _G.string;
+local upper         = string.upper;
+local format        = string.format;
+local find          = string.find;
+local match         = string.match;
+local gsub          = string.gsub;
+--MATH
+local math          = _G.math;
+local floor         = math.floor;
+local random        = math.random;
+--TABLE
+local table         = _G.table;
+local tsort         = table.sort;
+local tconcat       = table.concat;
+local tinsert       = _G.tinsert;
+local tremove       = _G.tremove;
+local twipe         = _G.wipe;
+--BLIZZARD API
+local ReloadUI              = _G.ReloadUI;
+local GetLocale             = _G.GetLocale;
+local CreateFrame           = _G.CreateFrame;
+local IsAddOnLoaded         = _G.IsAddOnLoaded;
+local InCombatLockdown      = _G.InCombatLockdown;
+local GetAddOnInfo          = _G.GetAddOnInfo;
+local LoadAddOn             = _G.LoadAddOn;
+local SendAddonMessage      = _G.SendAddonMessage;
+local LibStub               = _G.LibStub;
+local GetAddOnMetadata      = _G.GetAddOnMetadata;
+local GetCVarBool           = _G.GetCVarBool;
+local GameTooltip           = _G.GameTooltip;
+local StaticPopup_Hide      = _G.StaticPopup_Hide;
+local ERR_NOT_IN_COMBAT     = _G.ERR_NOT_IN_COMBAT;
+
 local SV = select(2, ...)
 local L = SV.L
 local MOD = SV:NewPackage("SVHenchmen", L["Henchmen"]);
@@ -108,7 +162,7 @@ end

 local Option_OnMouseUp = function(self)
 	if(type(self.callback) == "function") then
-		self:callback(param)
+		self:callback()
 	end
 end

diff --git a/Interface/AddOns/SVUI/packages/override/SVOverride.lua b/Interface/AddOns/SVUI/packages/override/SVOverride.lua
index 454c407..22317b6 100644
--- a/Interface/AddOns/SVUI/packages/override/SVOverride.lua
+++ b/Interface/AddOns/SVUI/packages/override/SVOverride.lua
@@ -18,16 +18,27 @@ LOCALIZED LUA FUNCTIONS
 ]]--
 --[[ GLOBALS ]]--
 local _G = _G;
-local unpack 	= _G.unpack;
-local select 	= _G.select;
-local pairs 	= _G.pairs;
+local unpack        = _G.unpack;
+local select        = _G.select;
+local assert        = _G.assert;
+local type          = _G.type;
+local error         = _G.error;
+local pcall         = _G.pcall;
+local print         = _G.print;
+local ipairs        = _G.ipairs;
+local pairs         = _G.pairs;
+local next          = _G.next;
+local rawset        = _G.rawset;
+local rawget        = _G.rawget;
+local tostring      = _G.tostring;
+local tonumber      = _G.tonumber;
 local tinsert 	= _G.tinsert;
 local string 	= _G.string;
 local math 		= _G.math;
 --[[ STRING METHODS ]]--
 local find, format, len, split = string.find, string.format, string.len, string.split;
 --[[ MATH METHODS ]]--
-local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round;
+local abs, ceil, floor, round, max = math.abs, math.ceil, math.floor, math.round, math.max;
 --[[
 ##########################################################
 GET ADDON DATA
@@ -38,6 +49,8 @@ local L = SV.L
 local LSM = LibStub("LibSharedMedia-3.0")
 local MOD = SV:NewPackage("SVOverride", "Overrides");
 MOD.LewtRollz = {};
+
+local MyName = UnitName("player");
 --[[
 ##########################################################
 LOCAL VARS
@@ -161,7 +174,7 @@ function MOD:DisbandRaidGroup()
 	if UnitInRaid("player") then
 		for i = 1, GetNumGroupMembers() do
 			local name, _, _, _, _, _, _, online = GetRaidRosterInfo(i)
-			if online and name ~= E.myname then
+			if online and name ~= MyName then
 				UninviteUnit(name)
 			end
 		end
@@ -395,7 +408,7 @@ local function MirrorBarRegistry(barType)
 	bar:SetStatusBarColor(r, g, b)
 	bar.type = barType;
 	bar.Start = MirrorBar_Start;
-	bar.Stop = Stop;
+	-- bar.Stop = nil;
 	SetMirrorPosition(bar)
 	RegisteredMirrorBars[barType] = bar;
 	return bar
diff --git a/Interface/AddOns/SVUI/packages/plates/SVPlate.lua b/Interface/AddOns/SVUI/packages/plates/SVPlate.lua
index b00c06e..1e9548a 100644
--- a/Interface/AddOns/SVUI/packages/plates/SVPlate.lua
+++ b/Interface/AddOns/SVUI/packages/plates/SVPlate.lua
@@ -39,7 +39,7 @@ local lower, upper = string.lower, string.upper;
 local find, format, split = string.find, string.format, string.split;
 local match, gmatch, gsub = string.match, string.gmatch, string.gsub;
 --[[ MATH METHODS ]]--
-local floor = math.floor;  -- Basic
+local floor, ceil = math.floor, math.ceil;  -- Basic
 --[[ BINARY METHODS ]]--
 local band, bor = bit.band, bit.bor;
 --[[ TABLE METHODS ]]--
@@ -642,7 +642,8 @@ PLATE UPDATE HANDLERS
 ]]--
 do
 	local function IsNamePlate(frame)
-		if frame:GetName() and strfind(frame:GetName(), '^NamePlate%d') then
+		local frameName = frame:GetName()
+		if frameName and frameName:find('^NamePlate%d') then
 			local textObj = select(2, frame:GetChildren())
 			if textObj then
 				local textRegions = textObj:GetRegions()
diff --git a/Interface/AddOns/SVUI/packages/stats/SVStats.lua b/Interface/AddOns/SVUI/packages/stats/SVStats.lua
index 3d94bb0..4f94a8b 100644
--- a/Interface/AddOns/SVUI/packages/stats/SVStats.lua
+++ b/Interface/AddOns/SVUI/packages/stats/SVStats.lua
@@ -18,10 +18,20 @@ LOCALIZED LUA FUNCTIONS
 ]]--
 --[[ GLOBALS ]]--
 local _G = _G;
-local unpack    = _G.unpack;
-local select    = _G.select;
-local pairs     = _G.pairs;
-local type      = _G.type;
+local unpack        = _G.unpack;
+local select        = _G.select;
+local assert        = _G.assert;
+local type          = _G.type;
+local error         = _G.error;
+local pcall         = _G.pcall;
+local print         = _G.print;
+local ipairs        = _G.ipairs;
+local pairs         = _G.pairs;
+local next          = _G.next;
+local rawset        = _G.rawset;
+local rawget        = _G.rawget;
+local tostring      = _G.tostring;
+local tonumber      = _G.tonumber;
 local string    = _G.string;
 local math      = _G.math;
 local table 	= _G.table;
@@ -29,7 +39,13 @@ local table 	= _G.table;
 local join, len = string.join, string.len;
 --[[ MATH METHODS ]]--
 local min = math.min;
-local tsort, twipe = table.sort, _G.wipe;
+--TABLE
+local table         = _G.table;
+local tsort         = table.sort;
+local tconcat       = table.concat;
+local tinsert       = _G.tinsert;
+local tremove       = _G.tremove;
+local twipe         = _G.wipe;
 --[[
 ##########################################################
 GET ADDON DATA
@@ -122,18 +138,19 @@ end
 local UpdateAnchor = function()
 	local backdrops, width, height = SV.db.SVStats.showBackground
 	for _, anchor in pairs(MOD.Anchors) do
+		local numPoints = anchor.numPoints
 		if(anchor.vertical) then
 			width = anchor:GetWidth() - 4;
-			height = anchor:GetHeight() / anchor.numPoints - 4;
+			height = anchor:GetHeight() / numPoints - 4;
 		else
-			width = anchor:GetWidth() / anchor.numPoints - 4;
+			width = anchor:GetWidth() / numPoints - 4;
 			height = anchor:GetHeight() - 4;
 			if(backdrops) then
 				height = RightSuperDockToggleButton:GetHeight() - 6
 			end
 		end

-		for i = 1, anchor.numPoints do
+		for i = 1, numPoints do
 			local this = positionIndex[anchor.useIndex][i]
 			anchor.holders[this]:Width(width)
 			anchor.holders[this]:Height(height)
@@ -418,7 +435,7 @@ do
 		StatMenuFrame:SetSize(maxWidth, maxHeight)
 		StatMenuFrame:ClearAllPoints()
 		local point = _locate(self:GetParent())
-		if strfind(point, "BOTTOM") then
+		if point:find("BOTTOM") then
 			StatMenuFrame:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 10, 10)
 		else
 			StatMenuFrame:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 10, -10)
diff --git a/Interface/AddOns/SVUI/packages/stats/stats/experience.lua b/Interface/AddOns/SVUI/packages/stats/stats/experience.lua
index eafb704..3497e58 100644
--- a/Interface/AddOns/SVUI/packages/stats/stats/experience.lua
+++ b/Interface/AddOns/SVUI/packages/stats/stats/experience.lua
@@ -28,6 +28,9 @@ local string 	= _G.string;
 --[[ STRING METHODS ]]--
 local format = string.format;
 local gsub = string.gsub;
+--MATH
+local math          = _G.math;
+local min         = math.min
 --[[
 ##########################################################
 GET ADDON DATA
diff --git a/Interface/AddOns/SVUI/packages/stats/stats/friends.lua b/Interface/AddOns/SVUI/packages/stats/stats/friends.lua
index b0fc852..5cc8bd9 100644
--- a/Interface/AddOns/SVUI/packages/stats/stats/friends.lua
+++ b/Interface/AddOns/SVUI/packages/stats/stats/friends.lua
@@ -43,7 +43,7 @@ local gmatch, gsub = string.gmatch, string.gsub;
 --[[ MATH METHODS ]]--
 local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round;  -- Basic
 --[[ TABLE METHODS ]]--
-local twipe, tsort = table.wipe, table.sort;
+local wipe, sort = table.wipe, table.sort;
 --[[
 ##########################################################
 GET ADDON DATA
@@ -292,7 +292,7 @@ end

 local function OnEnter(self)
 	MOD:Tip(self)
-
+	local grouped
 	local numberOfFriends, onlineFriends = GetNumFriends()
 	local totalBNet, numBNetOnline = BNGetNumFriends()

diff --git a/Interface/AddOns/SVUI/packages/stats/stats/guild.lua b/Interface/AddOns/SVUI/packages/stats/stats/guild.lua
index 8990323..bc6dcb9 100644
--- a/Interface/AddOns/SVUI/packages/stats/stats/guild.lua
+++ b/Interface/AddOns/SVUI/packages/stats/stats/guild.lua
@@ -110,7 +110,7 @@ end
 local function GetGuildStatMembers()
 	twipe(GuildStatMembers)
 	local statusFormat;
-	local _, name, rank, level, zone, note, officernote, online, status, classFileName, isMobile;
+	local _, name, rank, level, zone, note, officernote, online, status, classFileName, isMobile, rankIndex;
 	for i = 1, GetNumGuildMembers() do
 		name, rank, rankIndex, level, _, zone, note, officernote, online, status, classFileName, _, _, isMobile = GetGuildRosterInfo(i)
 		statusFormat = isMobile and MobileFlagFormat[status]() or UnitFlagFormat[status]()
diff --git a/Interface/AddOns/SVUI/packages/stats/stats/time.lua b/Interface/AddOns/SVUI/packages/stats/stats/time.lua
index 39755a5..e753a8d 100644
--- a/Interface/AddOns/SVUI/packages/stats/stats/time.lua
+++ b/Interface/AddOns/SVUI/packages/stats/stats/time.lua
@@ -57,6 +57,7 @@ local lockoutColorExtended, lockoutColorNormal = { r=0.3,g=1,b=0.3 }, { r=.8,g=.
 local lockoutFormatString = { "%dd %02dh %02dm", "%dd %dh %02dm", "%02dh %02dm", "%dh %02dm", "%dh %02dm", "%dm" }
 local curHr, curMin, curAmPm
 local enteredFrame = false;
+local date = _G.date

 local Update, lastPanel; -- UpValue
 local localizedName, isActive, canQueue, startTime, canEnter, _
@@ -91,7 +92,7 @@ local function CalculateTimeValues(tooltip)
 	if (tooltip and SV.db.SVStats.localtime) or (not tooltip and not SV.db.SVStats.localtime) then
 		return ConvertTime(GetGameTime())
 	else
-		local	dateTable =	date("*t")
+		local dateTable = date("*t")
 		return ConvertTime(dateTable["hour"], dateTable["min"])
 	end
 end
@@ -105,7 +106,7 @@ local function OnLeave(self)
 	enteredFrame = false;
 end

-local function OnEvent()
+local function OnEvent(self, event)
 	if event == "UPDATE_INSTANCE_INFO" and enteredFrame then
 		RequestRaidInfo()
 	end
diff --git a/Interface/AddOns/SVUI/packages/tip/SVTip.lua b/Interface/AddOns/SVUI/packages/tip/SVTip.lua
index 6a92e5f..e97e773 100644
--- a/Interface/AddOns/SVUI/packages/tip/SVTip.lua
+++ b/Interface/AddOns/SVUI/packages/tip/SVTip.lua
@@ -40,6 +40,7 @@ local SV = select(2, ...)
 local L = SV.L
 local LSM = LibStub("LibSharedMedia-3.0")
 local MOD = SV:NewPackage("SVTip", L["Tooltip"]);
+local ID = _G.ID;
 --[[
 ##########################################################
 LOCAL VARIABLES
@@ -613,10 +614,10 @@ local _hook_OnTipCleared = function(self)
 	self.itemCleared = nil
 end

-local _hook_OnItemRef = function(link,text,button,chatFrame)
-	if find(link,"^spell:") then
+local _hook_OnItemRef = function(link, text, button, chatFrame)
+	if link:find("^spell:") then
 		local ref = sub(link,7)
-		ItemRefTooltip:AddLine(("|cFFCA3C3C%s|r %d"):format(ID,ref))
+		ItemRefTooltip:AddLine(("|cFFCA3C3C%s|r %d"):format(ID, ref))
 		ItemRefTooltip:Show()
 	end
 end
diff --git a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua
index 12023ad..5c97e27 100644
--- a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua
+++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua
@@ -433,10 +433,8 @@ function MOD:RefreshUnitMedia(unitName)
         end
         if(self.Castbar and (unitDB.castbar)) then
             if(unitDB.castbar.useCustomColor) then
-				cr,cg,cb = unitDB.castbar.castingColor[1], unitDB.castbar.castingColor[2], unitDB.castbar.castingColor[3];
-				self.Castbar.CastColor = {cr,cg,cb}
-				cr,cg,cb = unitDB.castbar.sparkColor[1], unitDB.castbar.sparkColor[2], unitDB.castbar.sparkColor[3];
-				self.Castbar.SparkColor = {cr,cg,cb}
+				self.Castbar.CastColor = unitDB.castbar.castingColor
+				self.Castbar.SparkColor = unitDB.castbar.sparkColor
 			else
 				self.Castbar.CastColor = oUF_Villain.colors.casting
 				self.Castbar.SparkColor = oUF_Villain.colors.spark
@@ -1009,7 +1007,7 @@ function MOD:RefreshUnitLayout(frame, template)
 			elseif(db.aurabar.attachTo == "DEBUFFS" and frame.Debuffs and frame.Debuffs:IsShown()) then
 				attachTo = frame.Debuffs
 				preOffset = 10
-			elseif not isPlayer and SVUI_Player and db.aurabar.attachTo == "PLAYER_AURABARS" then
+			elseif template ~= "player" and SVUI_Player and db.aurabar.attachTo == "PLAYER_AURABARS" then
 				attachTo = SVUI_Player.AuraBars
 				preOffset = 10
 			end
diff --git a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua
index 20d02f2..03ab962 100644
--- a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua
+++ b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua
@@ -44,6 +44,8 @@ local match         = string.match;
 local gsub          = string.gsub;
 --MATH
 local math          = math;
+local floor         = math.floor
+local ceil         	= math.ceil
 --TABLE
 local table         = table;
 local tsort         = table.sort;
diff --git a/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua b/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua
index f47c6f4..7722dd6 100644
--- a/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua
+++ b/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua
@@ -16,22 +16,21 @@ S U P E R - V I L L A I N - U I  By: Munglunch               #
 LOCALIZED LUA FUNCTIONS
 ##########################################################
 ]]--
---LUA
-local unpack        = unpack;
-local select        = select;
-local pairs         = pairs;
-local type          = type;
-local rawset        = rawset;
-local rawget        = rawget;
-local tostring      = tostring;
-local error         = error;
-local next          = next;
-local pcall         = pcall;
-local getmetatable  = getmetatable;
-local setmetatable  = setmetatable;
-local assert        = assert;
---BLIZZARD
 local _G            = _G;
+local unpack        = _G.unpack;
+local select        = _G.select;
+local assert        = _G.assert;
+local type          = _G.type;
+local error         = _G.error;
+local pcall         = _G.pcall;
+local print         = _G.print;
+local ipairs        = _G.ipairs;
+local pairs         = _G.pairs;
+local next          = _G.next;
+local rawset        = _G.rawset;
+local rawget        = _G.rawget;
+local tostring      = _G.tostring;
+local tonumber      = _G.tonumber;
 local tinsert       = _G.tinsert;
 local tremove       = _G.tremove;
 local twipe         = _G.wipe;
diff --git a/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua b/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua
index 4eb14f4..74282de 100644
--- a/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua
+++ b/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua
@@ -16,15 +16,36 @@ S U P E R - V I L L A I N - U I   By: Munglunch                              #
 LOCALIZED LUA FUNCTIONS
 ##########################################################
 ]]--
+local _G = _G;
 --LUA
-local unpack        = unpack;
-local select        = select;
-local assert        = assert;
---BLIZZARD
-local _G            = _G;
+local unpack        = _G.unpack;
+local select        = _G.select;
+local assert        = _G.assert;
+local type          = _G.type;
+local error         = _G.error;
+local pcall         = _G.pcall;
+local print         = _G.print;
+local ipairs        = _G.ipairs;
+local pairs         = _G.pairs;
+local next          = _G.next;
+local rawset        = _G.rawset;
+local rawget        = _G.rawget;
+local tostring      = _G.tostring;
+local tonumber      = _G.tonumber;
+local getmetatable  = _G.getmetatable;
+local setmetatable  = _G.setmetatable;
+--STRING
+local string        = _G.string;
+local upper         = string.upper;
+local format        = string.format;
+local find          = string.find;
+local match         = string.match;
+local gsub          = string.gsub;
 --MATH
-local math          = math;
+local math          = _G.math;
 local random        = math.random;
+local floor         = math.floor
+local ceil         	= math.ceil
 --[[
 ##########################################################
 GET ADDON DATA
@@ -82,7 +103,7 @@ local Anim_OnStop = function(self)
 end

 local function SetNewAnimation(frame, animType, parent)
-	local anim = frame:CreateAnimation(animType, subType)
+	local anim = frame:CreateAnimation(animType)
 	anim.parent = parent
 	return anim
 end
@@ -313,7 +334,7 @@ local function CreateNameText(frame, unitName)
 	name:SetFont(LSM:Fetch("font", db.font), db.fontSize, db.fontOutline)
 	name:SetShadowOffset(2, -2)
 	name:SetShadowColor(0, 0, 0, 1)
-	if unitNmae == "target" then
+	if unitName == "target" then
 		name:SetPoint("RIGHT", frame)
 		name:SetJustifyH("RIGHT")
     	name:SetJustifyV("MIDDLE")
diff --git a/Interface/AddOns/SVUI/packages/unit/elements/misc.lua b/Interface/AddOns/SVUI/packages/unit/elements/misc.lua
index 581fe67..de86873 100644
--- a/Interface/AddOns/SVUI/packages/unit/elements/misc.lua
+++ b/Interface/AddOns/SVUI/packages/unit/elements/misc.lua
@@ -13,12 +13,37 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+local _G = _G;
 --LUA
-local unpack        = unpack;
-local select        = select;
-local assert        = assert;
---BLIZZARD
-local _G            = _G;
+local unpack        = _G.unpack;
+local select        = _G.select;
+local assert        = _G.assert;
+local type          = _G.type;
+local error         = _G.error;
+local pcall         = _G.pcall;
+local print         = _G.print;
+local ipairs        = _G.ipairs;
+local pairs         = _G.pairs;
+local next          = _G.next;
+local rawset        = _G.rawset;
+local rawget        = _G.rawget;
+local tostring      = _G.tostring;
+local tonumber      = _G.tonumber;
+local getmetatable  = _G.getmetatable;
+local setmetatable  = _G.setmetatable;
+--STRING
+local string        = _G.string;
+local upper         = string.upper;
+local format        = string.format;
+local find          = string.find;
+local match         = string.match;
+local gsub          = string.gsub;
+--MATH
+local math          = _G.math;
+local random        = math.random;
+local floor         = math.floor
+local ceil         	= math.ceil
+local max         	= math.max

 local SV = select(2, ...)
 local oUF_Villain = SV.oUF
diff --git a/Interface/AddOns/SVUI/packages/unit/elements/tags.lua b/Interface/AddOns/SVUI/packages/unit/elements/tags.lua
index f44def7..21dc69a 100644
--- a/Interface/AddOns/SVUI/packages/unit/elements/tags.lua
+++ b/Interface/AddOns/SVUI/packages/unit/elements/tags.lua
@@ -14,18 +14,45 @@ S U P E R - V I L L A I N - U I  By: Munglunch               #
 ##############################################################################
 ]]--
 --[[ GLOBALS ]]--
-local _G 		= _G;
-local unpack 	= unpack;
-local select 	= select;
-local pairs 	= pairs;
-local assert 	= assert;
-local table 	= table;
-local string 	= string;
---[[ STRING METHODS ]]--
-local find, format, byte, upper = string.find, string.format, string.byte, string.upper;
-local sub, gsub, len = string.sub, string.gsub, string.len;
---[[ TABLE METHODS ]]--
-local twipe = _G.wipe;
+local _G = _G;
+--LUA
+local unpack        = _G.unpack;
+local select        = _G.select;
+local assert        = _G.assert;
+local type          = _G.type;
+local error         = _G.error;
+local pcall         = _G.pcall;
+local print         = _G.print;
+local ipairs        = _G.ipairs;
+local pairs         = _G.pairs;
+local next          = _G.next;
+local rawset        = _G.rawset;
+local rawget        = _G.rawget;
+local tostring      = _G.tostring;
+local tonumber      = _G.tonumber;
+local getmetatable  = _G.getmetatable;
+local setmetatable  = _G.setmetatable;
+--STRING
+local string        = _G.string;
+local upper         = string.upper;
+local format        = string.format;
+local find          = string.find;
+local match         = string.match;
+local sub         	= string.sub;
+local gsub          = string.gsub;
+local byte 			= string.byte;
+local upper 		= string.upper;
+local len         	= string.len;
+--MATH
+local math          = _G.math;
+local floor         = math.floor
+--TABLE
+local table         = _G.table;
+local tsort         = table.sort;
+local tconcat       = table.concat;
+local tinsert       = _G.tinsert;
+local tremove       = _G.tremove;
+local twipe         = _G.wipe;
 --[[
 ##########################################################
 GET ADDON DATA
@@ -166,8 +193,8 @@ local function GetClassPower(class)
 		if spec == SPEC_WARLOCK_DESTRUCTION then
 			currentPower = UnitPower("player", SPELL_POWER_BURNING_EMBERS, true)
 			maxPower = UnitPowerMax("player", SPELL_POWER_BURNING_EMBERS, true)
-			currentPower = math.floor(currentPower / 10)
-			maxPower = math.floor(maxPower / 10)
+			currentPower = floor(currentPower / 10)
+			maxPower = floor(maxPower / 10)
 			r, g, b = 230 / 255, 95 / 255, 95 / 255
 		elseif spec == SPEC_WARLOCK_AFFLICTION then
 			currentPower = UnitPower("player", SPELL_POWER_SOUL_SHARDS)
@@ -375,7 +402,7 @@ oUF_Villain.Tags.Methods["power:curmax-percent"] = function(f)local j = UnitPowe

 oUF_Villain.Tags.Methods["power:percent"] = function(f)local j = UnitPowerType(f)local p = UnitPower(f, j)return p == 0 and" "or SetTagStyle("PERCENT", p, UnitPowerMax(f, j))end

-oUF_Villain.Tags.Methods["power:deficit"] = function(f)local j = UnitPowerType(f)return SetTagStyle("DEFICIT", UnitPower(f, j), UnitPowerMax(f, j), r, g, b)end
+oUF_Villain.Tags.Methods["power:deficit"] = function(f)local j = UnitPowerType(f) return SetTagStyle("DEFICIT", UnitPower(f, j), UnitPowerMax(f, j))end
 --[[
 ##########################################################
 MISC TAG METHODS
diff --git a/Interface/AddOns/SVUI/packages/unit/frames.lua b/Interface/AddOns/SVUI/packages/unit/frames.lua
index 7561c1e..ae7022d 100644
--- a/Interface/AddOns/SVUI/packages/unit/frames.lua
+++ b/Interface/AddOns/SVUI/packages/unit/frames.lua
@@ -979,7 +979,7 @@ local ArenaPrepHandler_OnEvent = function(self, event)
                 if(prepframe) then
                     if i <= numOpps then
                         local s = GetArenaOpponentSpec(i)
-                        local _, spec, class = nil, "UNKNOWN", "UNKNOWN"
+                        local _, spec, class, icon = nil, "UNKNOWN", "UNKNOWN", [[INTERFACE\ICONS\INV_MISC_QUESTIONMARK]]
                         if s and s > 0 then
                             _, spec, _, icon, _, _, class = GetSpecializationInfoByID(s)
                         end
@@ -1095,10 +1095,10 @@ local GroupMediaUpdate = function(self)
     while childFrame do
         MOD.RefreshUnitMedia(childFrame, key)
         if(_G[childFrame:GetName().."Pet"]) then
-            MOD.RefreshUnitMedia(_G[childFrame:GetName().."Pet"], key, updateElements)
+            MOD.RefreshUnitMedia(_G[childFrame:GetName().."Pet"], key)
         end
         if(_G[childFrame:GetName().."Target"]) then
-            MOD.RefreshUnitMedia(_G[childFrame:GetName().."Target"], key, updateElements)
+            MOD.RefreshUnitMedia(_G[childFrame:GetName().."Target"], key)
         end
         childFrame:UpdateAllElements()
         index = index + 1;
@@ -1874,7 +1874,7 @@ local GroupSetConfigEnvironment = function(self)
             end
             if not frame.isForced then
                 if not frame.initialized then
-                    frame:SetAttribute("startingIndex", db.customSorting and (-min(db.groupCount * db.gRowCol * 5, MAX_RAID_MEMBERS) + 1) or -4)
+                    frame:SetAttribute("startingIndex", db.customSorting and (-numMin(db.groupCount * db.gRowCol * 5, MAX_RAID_MEMBERS) + 1) or -4)
                     frame:Show()
                     frame.initialized = true
                 end
diff --git a/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua b/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua
index 29908af..113f4c7 100644
--- a/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua
+++ b/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua
@@ -121,7 +121,7 @@ function MOD:CreateClassBar(playerFrame)
 		bar[i].bg.multiplier = 0.1
 	end

-	local classBarHolder = CreateFrame("Frame", "Player_ClassBar", classBar)
+	local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar)
 	classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2)
 	bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0)
 	bar.Holder = classBarHolder
diff --git a/Interface/AddOns/SVUI/packages/unit/resources/druid.lua b/Interface/AddOns/SVUI/packages/unit/resources/druid.lua
index a51ffbe..7a64009 100644
--- a/Interface/AddOns/SVUI/packages/unit/resources/druid.lua
+++ b/Interface/AddOns/SVUI/packages/unit/resources/druid.lua
@@ -267,7 +267,7 @@ function MOD:CreateClassBar(playerFrame)
 		end
 	}

-	local classBarHolder = CreateFrame("Frame", "Player_ClassBar", classBar)
+	local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar)
 	classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2)
 	bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0)
 	bar.Holder = classBarHolder
@@ -309,7 +309,7 @@ local ShowSmallPoint = function(self)
 	self:SetAlpha(1)
 end

-local HideSmallPoint = function(self)
+local HideSmallPoint = function(self, i)
 	self.Icon:SetVertexColor(unpack(cpointColor[i]))
 	self:SetAlpha(0)
 end
diff --git a/Interface/AddOns/SVUI/packages/unit/resources/mage.lua b/Interface/AddOns/SVUI/packages/unit/resources/mage.lua
index eca1a28..9275f99 100644
--- a/Interface/AddOns/SVUI/packages/unit/resources/mage.lua
+++ b/Interface/AddOns/SVUI/packages/unit/resources/mage.lua
@@ -187,7 +187,7 @@ function MOD:CreateClassBar(playerFrame)
 	end

 	bar.Override = Update;
-	local classBarHolder = CreateFrame("Frame", "Player_ClassBar", classBar)
+	local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar)
 	classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2)
 	bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0)
 	bar.Holder = classBarHolder
diff --git a/Interface/AddOns/SVUI/packages/unit/resources/monk.lua b/Interface/AddOns/SVUI/packages/unit/resources/monk.lua
index 99c4bf8..e90a137 100644
--- a/Interface/AddOns/SVUI/packages/unit/resources/monk.lua
+++ b/Interface/AddOns/SVUI/packages/unit/resources/monk.lua
@@ -150,7 +150,7 @@ function MOD:CreateClassBar(playerFrame)
 		bar[i]:SetScript("OnHide", StopFlash)
 	end

-	local classBarHolder = CreateFrame("Frame", "Player_ClassBar", classBar)
+	local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar)
 	classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2)
 	bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0)
 	bar.Holder = classBarHolder
diff --git a/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua b/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua
index 89f056a..0834db8 100644
--- a/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua
+++ b/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua
@@ -179,7 +179,7 @@ function MOD:CreateClassBar(playerFrame)
 	end
 	bar.Override = Update;

-	local classBarHolder = CreateFrame("Frame", "Player_ClassBar", classBar)
+	local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar)
 	classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2)
 	bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0)
 	bar.Holder = classBarHolder
diff --git a/Interface/AddOns/SVUI/packages/unit/resources/priest.lua b/Interface/AddOns/SVUI/packages/unit/resources/priest.lua
index cd84430..394199a 100644
--- a/Interface/AddOns/SVUI/packages/unit/resources/priest.lua
+++ b/Interface/AddOns/SVUI/packages/unit/resources/priest.lua
@@ -151,7 +151,7 @@ function MOD:CreateClassBar(playerFrame)
 	end
 	bar.PreUpdate = PreUpdate

-	local classBarHolder = CreateFrame("Frame", "Player_ClassBar", classBar)
+	local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar)
 	classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2)
 	bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0)
 	bar.Holder = classBarHolder
diff --git a/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua b/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua
index 0a9c5f9..277931d 100644
--- a/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua
+++ b/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua
@@ -116,7 +116,7 @@ local ShowSmallPoint = function(self)
 	self:SetAlpha(1)
 end

-local HideSmallPoint = function(self)
+local HideSmallPoint = function(self, i)
 	self.Icon:SetVertexColor(unpack(cpointColor[i]))
 	self:SetAlpha(0)
 end
@@ -254,7 +254,7 @@ function MOD:CreateClassBar(playerFrame)

 	bar.Guile = guile;

-	local classBarHolder = CreateFrame("Frame", "Player_ClassBar", classBar)
+	local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar)
 	classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2)
 	bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0)
 	bar.Holder = classBarHolder
diff --git a/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua b/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua
index 0549aef..51cd23b 100644
--- a/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua
+++ b/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua
@@ -113,7 +113,7 @@ function MOD:CreateClassBar(playerFrame)
 		bar[i].backdrop:SetVertexColor(0.2,0.2,0.2,0.7)
 	end

-	local classBarHolder = CreateFrame("Frame", "Player_ClassBar", classBar)
+	local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar)
 	classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2)
 	bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0)
 	bar.Holder = classBarHolder
diff --git a/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua b/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua
index e02887b..b27f953 100644
--- a/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua
+++ b/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua
@@ -30,7 +30,7 @@ local tonumber  = _G.tonumber;
 local assert 	= _G.assert;
 local math 		= _G.math;
 --[[ MATH METHODS ]]--
-local random = math.random;
+local random, floor = math.random, math.floor;
 --[[
 ##########################################################
 GET ADDON DATA
@@ -356,7 +356,7 @@ function MOD:CreateClassBar(playerFrame)
 	bar.CurrentSpec = 0;
 	bar.Override = Update;

-	local classBarHolder = CreateFrame("Frame", "Player_ClassBar", classBar)
+	local classBarHolder = CreateFrame("Frame", "Player_ClassBar", bar)
 	classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2)
 	bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0)
 	bar.Holder = classBarHolder
diff --git a/Interface/AddOns/SVUI/scripts/questwatch.lua b/Interface/AddOns/SVUI/scripts/questwatch.lua
index e4e9627..5fc8b15 100644
--- a/Interface/AddOns/SVUI/scripts/questwatch.lua
+++ b/Interface/AddOns/SVUI/scripts/questwatch.lua
@@ -64,6 +64,15 @@ local SuperDockWindowRight;
 local currentQuestItems = {};
 local QuestDockletFrame, QuestDockletFrameTitle, QuestDockletFrameList, QuestDockletFrameSlider;
 local ICON_FILE = [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-QUESTS]]
+local WATCHFRAME_MAXLINEWIDTH = _G.WATCHFRAME_MAXLINEWIDTH;
+local WATCHFRAME_NUM_POPUPS = _G.WATCHFRAME_NUM_POPUPS;
+local WATCHFRAME_EXPANDEDWIDTH = _G.WATCHFRAME_EXPANDEDWIDTH;
+local WATCHFRAME_FILTER_TYPE = _G.WATCHFRAME_FILTER_TYPE;
+local WATCHFRAME_FILTER_COMPLETED_QUESTS = _G.WATCHFRAME_FILTER_COMPLETED_QUESTS;
+local WATCHFRAME_FILTER_ACHIEVEMENTS = _G.WATCHFRAME_FILTER_ACHIEVEMENTS;
+local WATCHFRAME_FILTER_REMOTE_ZONES = _G.WATCHFRAME_FILTER_REMOTE_ZONES;
+local OBJECTIVES_TRACKER_LABEL = _G.OBJECTIVES_TRACKER_LABEL;
+local WATCHFRAME_NUM_ITEMS = _G.WATCHFRAME_NUM_ITEMS;
 --[[
 ##########################################################
 PRE VARS/FUNCTIONS
@@ -296,9 +305,9 @@ end
 CORE FUNCTIONS
 ##########################################################
 ]]--
-local QuestDocklet_OnEvent = function(self, event)
+local QuestDocklet_OnEvent = function(self, event, arg)
 	if event == "CVAR_UPDATE" then
-		if action == "WATCH_FRAME_WIDTH_TEXT"then
+		if arg == "WATCH_FRAME_WIDTH_TEXT" then
 			if WatchFrame then
 				WatchFrame.OnUpdate()
 			end
diff --git a/Interface/AddOns/SVUI/setup/installer.lua b/Interface/AddOns/SVUI/setup/installer.lua
index 3ab0d4e..526bee7 100644
--- a/Interface/AddOns/SVUI/setup/installer.lua
+++ b/Interface/AddOns/SVUI/setup/installer.lua
@@ -18,9 +18,20 @@ LOCALIZED LUA FUNCTIONS
 ]]--
 --[[ GLOBALS ]]--
 local _G = _G;
-local unpack 	= _G.unpack;
-local select 	= _G.select;
-local type 		= _G.type;
+local unpack        = _G.unpack;
+local select        = _G.select;
+local assert        = _G.assert;
+local type          = _G.type;
+local error         = _G.error;
+local pcall         = _G.pcall;
+local print         = _G.print;
+local ipairs        = _G.ipairs;
+local pairs         = _G.pairs;
+local next          = _G.next;
+local rawset        = _G.rawset;
+local rawget        = _G.rawget;
+local tostring      = _G.tostring;
+local tonumber      = _G.tonumber;
 local string 	= _G.string;
 local table     = _G.table;
 local format = string.format;
@@ -51,6 +62,9 @@ local rcc = RAID_CLASS_COLORS[SV.class];
 local r2 = .1 + (rcc.r * .1)
 local g2 = .1 + (rcc.g * .1)
 local b2 = .1 + (rcc.b * .1)
+local SetCVar = _G.SetCVar;
+local ToggleChatColorNamesByClassGroup = _G.ToggleChatColorNamesByClassGroup;
+local ChatFrame_AddMessageGroup = _G.ChatFrame_AddMessageGroup;
 --[[
 ##########################################################
 SETUP CLASS OBJECT
@@ -291,13 +305,21 @@ end

 function SV.Setup:ChatConfigs(mungs)
 	forceCVars()
+
+	local ChatFrame1 = _G.ChatFrame1;
 	FCF_ResetChatWindows()
 	FCF_SetLocked(ChatFrame1, 1)
+
+	local ChatFrame2 = _G.ChatFrame2;
 	FCF_DockFrame(ChatFrame2)
 	FCF_SetLocked(ChatFrame2, 1)
+
 	FCF_OpenNewWindow(LOOT)
+
+	local ChatFrame3 = _G.ChatFrame3;
 	FCF_DockFrame(ChatFrame3)
 	FCF_SetLocked(ChatFrame3, 1)
+
 	for i = 1, NUM_CHAT_WINDOWS do
 		local chat = _G["ChatFrame"..i]
 		local chatID = chat:GetID()
diff --git a/Interface/AddOns/SVUI/setup/presets.lua b/Interface/AddOns/SVUI/setup/presets.lua
index a2d61a8..29b69cb 100644
--- a/Interface/AddOns/SVUI/setup/presets.lua
+++ b/Interface/AddOns/SVUI/setup/presets.lua
@@ -18,9 +18,20 @@ LOCALIZED LUA FUNCTIONS
 ]]--
 --[[ GLOBALS ]]--
 local _G = _G;
-local unpack 	= _G.unpack;
-local select 	= _G.select;
-local type 		= _G.type;
+local unpack        = _G.unpack;
+local select        = _G.select;
+local assert        = _G.assert;
+local type          = _G.type;
+local error         = _G.error;
+local pcall         = _G.pcall;
+local print         = _G.print;
+local ipairs        = _G.ipairs;
+local pairs         = _G.pairs;
+local next          = _G.next;
+local rawset        = _G.rawset;
+local rawget        = _G.rawget;
+local tostring      = _G.tostring;
+local tonumber      = _G.tonumber;
 local string 	= _G.string;
 local table     = _G.table;
 local format = string.format;
@@ -40,6 +51,11 @@ LOCAL VARS
 ]]--
 local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS
 local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS
+
+local CONTINUED = _G.CONTINUED
+local SETTINGS = _G.SETTINGS
+local HIGH = _G.HIGH
+local LOW = _G.LOW
 local scc = SVUI_CLASS_COLORS[SV.class];
 local rcc = RAID_CLASS_COLORS[SV.class];
 local r2 = .1 + (rcc.r * .1)
diff --git a/Interface/AddOns/SVUI/system/alerts.lua b/Interface/AddOns/SVUI/system/alerts.lua
index f8197a2..0308bb0 100644
--- a/Interface/AddOns/SVUI/system/alerts.lua
+++ b/Interface/AddOns/SVUI/system/alerts.lua
@@ -821,8 +821,8 @@ local function rng()
 end

 local function SetConfigAlertAnim(f)
-	local x = x or 50;
-	local y = y or 150;
+	local x = 50;
+	local y = 150;
 	f.trans = f:CreateAnimationGroup()
 	f.trans[1] = f.trans:CreateAnimation("Translation")
 	f.trans[1]:SetOrder(1)
@@ -873,6 +873,7 @@ function SV:LoadSystemAlerts()
 		configAlert:Size(300, 300)
 		configAlert:Point("CENTER", 200, -150)
 		configAlert:Hide()
+
 		configAlert.bg = CreateFrame("Frame", nil, configAlert)
 		configAlert.bg:Size(300, 300)
 		configAlert.bg:Point("CENTER")
@@ -881,6 +882,8 @@ function SV:LoadSystemAlerts()
 		local bgtex = configAlert.bg:CreateTexture(nil, "BACKGROUND")
 		bgtex:SetAllPoints()
 		bgtex:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\SAVED-BG")
+		SetConfigAlertAnim(configAlert.bg)
+
 		configAlert.fg = CreateFrame("Frame", nil, configAlert)
 		configAlert.fg:Size(300, 300)
 		configAlert.fg:Point("CENTER", bgtex, "CENTER")
@@ -889,8 +892,8 @@ function SV:LoadSystemAlerts()
 		local fgtex = configAlert.fg:CreateTexture(nil, "ARTWORK")
 		fgtex:SetAllPoints()
 		fgtex:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\SAVED-FG")
-		SetConfigAlertAnim(configAlert.bg, configAlert)
-		SetConfigAlertAnim(configAlert.fg, configAlert)
+		SetConfigAlertAnim(configAlert.fg)
+
 		SV.Animate:Orbit(configAlert.bg, 10, false, true)
 	end
 	for i = 1, 4 do
diff --git a/Interface/AddOns/SVUI/system/animate.lua b/Interface/AddOns/SVUI/system/animate.lua
index 5208c28..c5e5d0a 100644
--- a/Interface/AddOns/SVUI/system/animate.lua
+++ b/Interface/AddOns/SVUI/system/animate.lua
@@ -155,7 +155,7 @@ end

 local Slide_FadeStart = function(self)
 	local parent = self.parent
-	UIFrameFadeOut(parent, 0.3, 1, 0)
+	_G.UIFrameFadeOut(parent, 0.3, 1, 0)
 end

 local Slide_FadeStop = function(self)
diff --git a/Interface/AddOns/SVUI/system/common.lua b/Interface/AddOns/SVUI/system/common.lua
index 0cdaa92..bd4b3b1 100644
--- a/Interface/AddOns/SVUI/system/common.lua
+++ b/Interface/AddOns/SVUI/system/common.lua
@@ -862,7 +862,7 @@ local function CreatePanelTemplate(frame, templateName, underlay, noupdate, padd
         panel:SetPoint('TOPLEFT', frame, 'TOPLEFT', (xOffset * -1), yOffset)
         panel:SetPoint('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', xOffset, yOffset * -1)

-        if(padding > 0 and type(t) == 'table') then
+        if(padding > 0) then
             panel[1] = panel:CreateTexture(nil,"BORDER")
             panel[1]:SetTexture(0,0,0)
             panel[1]:SetPoint("TOPLEFT")
diff --git a/Interface/AddOns/SVUI/system/mentalo.lua b/Interface/AddOns/SVUI/system/mentalo.lua
index ca44714..de629c0 100644
--- a/Interface/AddOns/SVUI/system/mentalo.lua
+++ b/Interface/AddOns/SVUI/system/mentalo.lua
@@ -18,9 +18,15 @@ LOCALIZED LUA FUNCTIONS
 ]]--
 --[[ GLOBALS ]]--
 local _G = _G;
-local unpack 	= _G.unpack;
-local select 	= _G.select;
-local type 		= _G.type;
+local unpack    = _G.unpack;
+local select    = _G.select;
+local pairs     = _G.pairs;
+local ipairs    = _G.ipairs;
+local type      = _G.type;
+local error     = _G.error;
+local pcall     = _G.pcall;
+local tostring  = _G.tostring;
+local tonumber  = _G.tonumber;
 local string 	= _G.string;
 local math 		= _G.math;
 --[[ STRING METHODS ]]--
@@ -463,8 +469,8 @@ local Movable_OnDragStop = function(self)
 	MentaloUpdateHandler:SetScript("OnUpdate", nil)
 	MentaloUpdateHandler:Hide()

-	if(dragStopFunc ~= nil and type(dragStopFunc) == "function") then
-		dragStopFunc(self, Pinpoint(self))
+	if(self.postdrag ~= nil and type(self.postdrag) == "function") then
+		self:postdrag(Pinpoint(self))
 	end
 	self:SetUserPlaced(false)
 	TheHand:Disable()
diff --git a/Interface/AddOns/SVUI/system/moveable.lua b/Interface/AddOns/SVUI/system/moveable.lua
index 9a32207..7426602 100644
--- a/Interface/AddOns/SVUI/system/moveable.lua
+++ b/Interface/AddOns/SVUI/system/moveable.lua
@@ -21,6 +21,7 @@ local _G = _G;
 local unpack 	= _G.unpack;
 local select 	= _G.select;
 local type 		= _G.type;
+local pairs     = _G.pairs;
 local string 	= _G.string;
 local math 		= _G.math;
 --[[ STRING METHODS ]]--
diff --git a/Interface/AddOns/SVUI/system/timers.lua b/Interface/AddOns/SVUI/system/timers.lua
index 88ecd49..ffbf1b1 100644
--- a/Interface/AddOns/SVUI/system/timers.lua
+++ b/Interface/AddOns/SVUI/system/timers.lua
@@ -21,6 +21,7 @@ local _G = _G;
 local unpack 	= _G.unpack;
 local select 	= _G.select;
 local type 		= _G.type;
+local pairs     = _G.pairs;
 local tinsert 	= _G.tinsert;
 local string 	= _G.string;
 local math 		= _G.math;
diff --git a/Interface/AddOns/SVUI/system/utilities.lua b/Interface/AddOns/SVUI/system/utilities.lua
index fe7abb1..93ac86c 100644
--- a/Interface/AddOns/SVUI/system/utilities.lua
+++ b/Interface/AddOns/SVUI/system/utilities.lua
@@ -18,14 +18,23 @@ LOCALIZED LUA FUNCTIONS
 ]]--
 --[[ GLOBALS ]]--
 local _G = _G;
-local unpack    = _G.unpack;
-local select    = _G.select;
-local pairs     = _G.pairs;
-local type      = _G.type;
-local tostring  = _G.tostring;
-local tonumber  = _G.tonumber;
-local string    = _G.string;
-local math      = _G.math;
+local unpack        = _G.unpack;
+local select        = _G.select;
+local assert        = _G.assert;
+local type          = _G.type;
+local error         = _G.error;
+local pcall         = _G.pcall;
+local print         = _G.print;
+local ipairs        = _G.ipairs;
+local pairs         = _G.pairs;
+local next          = _G.next;
+local rawset        = _G.rawset;
+local rawget        = _G.rawget;
+local tostring      = _G.tostring;
+local tonumber      = _G.tonumber;
+local table         = _G.table;
+local string        = _G.string;
+local math          = _G.math;
 --[[ STRING METHODS ]]--
 local match, format = string.match, string.format;
 local gmatch, gsub = string.gmatch, string.gsub;
diff --git a/Interface/AddOns/SVUI/system/visibility.lua b/Interface/AddOns/SVUI/system/visibility.lua
index 3842d35..3836bdf 100644
--- a/Interface/AddOns/SVUI/system/visibility.lua
+++ b/Interface/AddOns/SVUI/system/visibility.lua
@@ -21,6 +21,9 @@ local _G = _G;
 local unpack    = _G.unpack;
 local select    = _G.select;
 local pairs     = _G.pairs;
+local tinsert       = _G.tinsert;
+local tremove       = _G.tremove;
+local twipe         = _G.wipe;
 --[[
 ##########################################################
 GET ADDON DATA
diff --git a/Interface/AddOns/SVUI_ChatOMatic/components/answering_service.lua b/Interface/AddOns/SVUI_ChatOMatic/components/answering_service.lua
index b2ad275..2a5f905 100644
--- a/Interface/AddOns/SVUI_ChatOMatic/components/answering_service.lua
+++ b/Interface/AddOns/SVUI_ChatOMatic/components/answering_service.lua
@@ -26,6 +26,7 @@ local type      = _G.type;
 local error     = _G.error;
 local pcall     = _G.pcall;
 local assert    = _G.assert;
+local print    	= _G.print;
 local tostring  = _G.tostring;
 local tonumber  = _G.tonumber;
 local tinsert   = _G.tinsert;
@@ -481,7 +482,7 @@ do
 	end

 	local function PadString(strng)
-		aString = " "..strng.." "
+		local aString = " "..strng.." "
 		for i = 1, 12, 1 do
 			aString = gsub(aString, punctuations[i].pattern, " "..punctuations[i].value.." ")
 		end
@@ -489,7 +490,7 @@ do
 	end

 	local function UnPadString(strng)
-		aString = strng
+		local aString = strng
 		aString = gsub(aString, "  ", " ")
 		if sub(aString, 1, 1) == " " then
 			aString = sub(aString, 2)
@@ -539,7 +540,7 @@ do
 		local phrase;
 		local wordkey = Responses[keyid].Key;
 		local links = Responses[keyid].Dialog;
-		idrange = #links
+		local idrange = #links
 		if idrange > 1 then
 			while(not phrase) do
 				local mod = floor(random(1, idrange))
@@ -551,7 +552,7 @@ do
 		else
 			data.LastKey = 1
 		end
-		local tempt = sub(phrase, -1, -1)
+		local tempt = phrase and sub(phrase, -1, -1) or ''
 		local sTemp = ""
 		if tempt == "*" or tempt == "@" then
 			sTemp = PadString(sString)
diff --git a/Interface/AddOns/SVUI_ChatOMatic/components/chat_history.lua b/Interface/AddOns/SVUI_ChatOMatic/components/chat_history.lua
index d267cb8..378ff4c 100644
--- a/Interface/AddOns/SVUI_ChatOMatic/components/chat_history.lua
+++ b/Interface/AddOns/SVUI_ChatOMatic/components/chat_history.lua
@@ -22,10 +22,13 @@ local unpack 	= _G.unpack;
 local select 	= _G.select;
 local pairs 	= _G.pairs;
 local type 		= _G.type;
+local tostring  = _G.tostring;
+local tonumber  = _G.tonumber;
 local tinsert 	= _G.tinsert;
 local string 	= _G.string;
 local math 		= _G.math;
 local table 	= _G.table;
+local time 		= _G.time;
 --[[ STRING METHODS ]]--
 local format, split = string.format, string.split;
 --[[ MATH METHODS ]]--
diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua
index d4b243c..db76226 100644
--- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua
+++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua
@@ -1,4 +1,4 @@
---[[
+--[[
 ##############################################################################
 _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
  ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__      #
diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/bar.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/bar.lua
index b6e59a7..7b8737b 100644
--- a/Interface/AddOns/SVUI_ConfigOMatic/components/bar.lua
+++ b/Interface/AddOns/SVUI_ConfigOMatic/components/bar.lua
@@ -237,58 +237,8 @@ local function BarConfigLoader()
 		}
 	end

-	bar_configs["Micro"] = {
-		order = d,
-		name = L["Micro Menu"],
-		type = "group",
-		order = 100,
-		guiInline = false,
-		disabled = function()return not SV.db.SVBar.enable end,
-		get = function(key)
-			return SV.db.SVBar["Micro"][key[#key]]
-		end,
-		set = function(key, value)
-			MOD:ChangeDBVar(value, key[#key], "Micro");
-			MOD:UpdateMicroButtons()
-		end,
-		args = {
-			enable = {
-				order = 1,
-				type = "toggle",
-				name = L["Enable"]
-			},
-			mouseover = {
-				order = 2,
-				name = L["Mouse Over"],
-				desc = L["The frame is not shown unless you mouse over the frame."],
-				disabled = function()return not SV.db.SVBar["Micro"].enable end,
-				type = "toggle"
-			},
-			buttonsize = {
-				order = 3,
-				type = "range",
-				name = L["Button Size"],
-				desc = L["The size of the action buttons."],
-				min = 15,
-				max = 60,
-				step = 1,
-				disabled = function()return not SV.db.SVBar["Micro"].enable end,
-			},
-			buttonspacing = {
-				order = 4,
-				type = "range",
-				name = L["Button Spacing"],
-				desc = L["The spacing between buttons."],
-				min = 1,
-				max = 10,
-				step = 1,
-				disabled = function()return not SV.db.SVBar["Micro"].enable end,
-			},
-		}
-	};
-
 	bar_configs["Pet"] = {
-		order = d,
+		order = 7,
 		name = L["Pet Bar"],
 		type = "group",
 		order = 200,
@@ -439,7 +389,7 @@ local function BarConfigLoader()
 	};

 	bar_configs["Stance"] = {
-		order = d,
+		order = 8,
 		name = L["Stance Bar"],
 		type = "group",
 		order = 300,
@@ -606,7 +556,57 @@ local function BarConfigLoader()
 				}
 			}
 		}
-	}
+	};
+
+	bar_configs["Micro"] = {
+		order = 9,
+		name = L["Micro Menu"],
+		type = "group",
+		order = 100,
+		guiInline = false,
+		disabled = function()return not SV.db.SVBar.enable end,
+		get = function(key)
+			return SV.db.SVBar["Micro"][key[#key]]
+		end,
+		set = function(key, value)
+			MOD:ChangeDBVar(value, key[#key], "Micro");
+			MOD:UpdateMicroButtons()
+		end,
+		args = {
+			enable = {
+				order = 1,
+				type = "toggle",
+				name = L["Enable"]
+			},
+			mouseover = {
+				order = 2,
+				name = L["Mouse Over"],
+				desc = L["The frame is not shown unless you mouse over the frame."],
+				disabled = function()return not SV.db.SVBar["Micro"].enable end,
+				type = "toggle"
+			},
+			buttonsize = {
+				order = 3,
+				type = "range",
+				name = L["Button Size"],
+				desc = L["The size of the action buttons."],
+				min = 15,
+				max = 60,
+				step = 1,
+				disabled = function()return not SV.db.SVBar["Micro"].enable end,
+			},
+			buttonspacing = {
+				order = 4,
+				type = "range",
+				name = L["Button Spacing"],
+				desc = L["The spacing between buttons."],
+				min = 1,
+				max = 10,
+				step = 1,
+				disabled = function()return not SV.db.SVBar["Micro"].enable end,
+			},
+		}
+	};
 end

 SV.Options.args.SVBar = {
diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/dock.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/dock.lua
index f25e565..4d218e2 100644
--- a/Interface/AddOns/SVUI_ConfigOMatic/components/dock.lua
+++ b/Interface/AddOns/SVUI_ConfigOMatic/components/dock.lua
@@ -152,8 +152,8 @@ local function GetLiveDockletsA()
 	local t = {["None"] = L["None"]};
 	for n,l in pairs(acceptableDocklets) do
 		if IsAddOnLoaded(n) or IsAddOnLoaded(l) then
-			if n=="Skada" and Skada then
-				for index,window in pairs(Skada:GetWindows()) do
+			if n == "Skada" and _G.Skada then
+				for index,window in pairs(_G.Skada:GetWindows()) do
 				    local key = window.db.name
 				    t["Skada"..key] = (key=="Skada") and "Skada - Main" or "Skada - "..key;
 				end
@@ -170,8 +170,8 @@ local function GetLiveDockletsB()
 	local t = {["None"] = L["None"]};
 	for n,l in pairs(acceptableDocklets) do
 		if IsAddOnLoaded(n) or IsAddOnLoaded(l) then
-			if n=="Skada" and Skada then
-				for index,window in pairs(Skada:GetWindows()) do
+			if n == "Skada" and _G.Skada then
+				for index,window in pairs(_G.Skada:GetWindows()) do
 				    local key = window.db.name
 				    t["Skada"..key] = (key=="Skada") and "Skada - Main" or "Skada - "..key;
 				end
diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/filter.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/filter.lua
index a59fabb..510a786 100644
--- a/Interface/AddOns/SVUI_ConfigOMatic/components/filter.lua
+++ b/Interface/AddOns/SVUI_ConfigOMatic/components/filter.lua
@@ -18,8 +18,22 @@ LOCALIZED LUA FUNCTIONS
 ]]--
 --[[ GLOBALS ]]--
 local _G = _G;
-local unpack 	 =  _G.unpack;
-local pairs 	 =  _G.pairs;
+local unpack        = _G.unpack;
+local select        = _G.select;
+local assert        = _G.assert;
+local type          = _G.type;
+local error         = _G.error;
+local pcall         = _G.pcall;
+local print         = _G.print;
+local ipairs        = _G.ipairs;
+local pairs         = _G.pairs;
+local next          = _G.next;
+local rawset        = _G.rawset;
+local rawget        = _G.rawget;
+local tostring      = _G.tostring;
+local tonumber      = _G.tonumber;
+local getmetatable  = _G.getmetatable;
+local setmetatable  = _G.setmetatable;
 local tinsert 	 =  _G.tinsert;
 local table 	 =  _G.table;
 --[[ TABLE METHODS ]]--
@@ -33,6 +47,7 @@ local SV = _G["SVUI"];
 local L = SV.L;
 local MOD = SV.SVUnit
 if(not MOD) then return end
+
 local _, ns = ...;
 local selectedSpell,filterType,filters;
 local nameMapping = {
@@ -47,6 +62,10 @@ local nameMapping = {
 	["PetBuffWatch"] = "(AuraWatch) Pet Buffs",
 }

+local NONE = _G.NONE;
+local GetSpellInfo = _G.GetSpellInfo;
+local collectgarbage = _G.collectgarbage;
+
 local function generateFilterOptions()
 	if filterType == 'AuraBar Colors' then

@@ -472,8 +491,11 @@ local function generateFilterOptions()
 				}
 			}
 		}
+
 		local registeredSpell;
+
 		for t,l in pairs(SV.db.filter.BuffWatch)do if l.id==selectedSpell then registeredSpell=t end end
+
 		if selectedSpell and registeredSpell then
 			local currentSpell=GetSpellInfo(selectedSpell)
 			SV.Options.args.filters.args.filterGroup.args[currentSpell] = {
@@ -667,7 +689,7 @@ local function generateFilterOptions()
 					name = L["Enable"],
 					type = "toggle",
 					get = function()
-						if selectedFolder or not selectedSpell then
+						if not selectedSpell then
 							return false
 						else
 							return SV.db.filter[filterType][selectedSpell].enable
@@ -683,7 +705,7 @@ local function generateFilterOptions()
 					name = L["Priority"],
 					type = "range",
 					get = function()
-						if selectedFolder or not selectedSpell then
+						if not selectedSpell then
 							return 0
 						else
 							return SV.db.filter[filterType][selectedSpell].priority
@@ -704,7 +726,8 @@ local function generateFilterOptions()
 	end
 	MOD:RefreshUnitFrames()
 	collectgarbage("collect")
-end
+end
+
 SV.Options.args.filters = {
 	type = "group",
 	name = L["Filters"],
@@ -777,5 +800,5 @@ SV.Options.args.filters = {
 function ns:SetToFilterConfig(newFilter)
 	filterType = newFilter or "BuffWatch"
 	generateFilterOptions()
-	LibStub("AceConfigDialog-3.0"):SelectGroup(SV.NameID, "filters")
+	_G.LibStub("AceConfigDialog-3.0"):SelectGroup(SV.NameID, "filters")
 end
\ No newline at end of file
diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/plate.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/plate.lua
index 3f5e41c..32d824c 100644
--- a/Interface/AddOns/SVUI_ConfigOMatic/components/plate.lua
+++ b/Interface/AddOns/SVUI_ConfigOMatic/components/plate.lua
@@ -431,7 +431,7 @@ SV.Options.args.SVPlate = {
 					order = 4,
 					name = L["Target Indicator"],
 					get = function(d)return SV.db.SVPlate.pointer[d[#d]]end,
-					set = function(d,e)MOD:ChangeDBVar(e,d[#d],"pointer");WorldFrame.elapsed = 3;MOD:UpdateAllPlates()end,
+					set = function(d,e) MOD:ChangeDBVar(e,d[#d],"pointer"); _G.WorldFrame.elapsed = 3; MOD:UpdateAllPlates() end,
 					args = {
 						enable = {
 							order = 1,
@@ -446,7 +446,7 @@ SV.Options.args.SVPlate = {
 							set = function(key, value)
 								MOD:ChangeDBVar(value, key[#key], "pointer");
 								if value then
-									WorldFrame.elapsed = 3
+									_G.WorldFrame.elapsed = 3
 								end
 							end
 						},
@@ -530,7 +530,7 @@ SV.Options.args.SVPlate = {
 							name = L["Additional Filter"],
 							values = function()
 								filters = {}
-								filters[""] = NONE;
+								filters[""] = _G.NONE;
 								for j in pairs(SV.db.filter) do
 									filters[j] = j
 								end
@@ -701,7 +701,7 @@ SV.Options.args.SVPlate = {
 							name = L["Remove Name"],
 							get = function(d)return""end,
 							set = function(d,e)
-								if G["SVPlate"]["filter"][e]then
+								if SV.db["SVPlate"]["filter"][e] then
 									SV.db["SVPlate"]["filter"][e].enable = false;
 									SV:AddonMessage(L["You can't remove a default name from the filter,disabling the name."])
 								else
diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/profiles.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/profiles.lua
index d19affc..1c81bbd 100644
--- a/Interface/AddOns/SVUI_ConfigOMatic/components/profiles.lua
+++ b/Interface/AddOns/SVUI_ConfigOMatic/components/profiles.lua
@@ -1,4 +1,4 @@
---[[
+--[[
 ##############################################################################
 _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
  ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__      #
@@ -64,7 +64,7 @@ SV.Options.args.profiles = {
 			order = 4,
 			type = "execute",
 			name = SAVE,
-			desc = function() return SAVE .. " " .. L["current"] .. " " .. NORMAL_FONT_COLOR_CODE .. profileKey .. FONT_COLOR_CODE_CLOSE end,
+			desc = function() return _G.SAVE .. " " .. L["current"] .. " |cffFFFF00" .. profileKey .. "|r" end,
 			func = function() SVLib:ExportDatabase(profileKey) SV:SavedPopup() end,
 		},
 		export = {
@@ -122,7 +122,7 @@ SV.Options.args.profiles = {
 		reset = {
 			order = 12,
 			type = "execute",
-			name = function() return L["reset"] .. " " .. NORMAL_FONT_COLOR_CODE .. profileKey .. FONT_COLOR_CODE_CLOSE end,
+			name = function() return L["reset"] .. " " .. " |cffFFFF00" .. profileKey .. "|r" end,
 			desc = L["reset_sub"],
 			func = function() SV:StaticPopup_Show("RESET_PROFILE_PROMPT") end,
 			width = "full",
diff --git a/Interface/AddOns/SVUI_ConfigOMatic/components/units/raid.lua b/Interface/AddOns/SVUI_ConfigOMatic/components/units/raid.lua
index 927758e..dc6ec19 100644
--- a/Interface/AddOns/SVUI_ConfigOMatic/components/units/raid.lua
+++ b/Interface/AddOns/SVUI_ConfigOMatic/components/units/raid.lua
@@ -662,8 +662,8 @@ SV.Options.args.SVUnit.args.raidpet ={
 							type = "toggle",
 							name = L["Enable"],
 							order = 1,
-							get = function(l)return SV.db.SVUnit["raid" .. w].auraWatch.enable end,
-							set = function(l, m)MOD:ChangeDBVar(m, "enable", "raid" .. w, "auraWatch");MOD:SetGroupFrame("raid" .. w)end,
+							get = function(l)return SV.db.SVUnit["raidpet"].auraWatch.enable end,
+							set = function(l, m)MOD:ChangeDBVar(m, "enable", "raidpet", "auraWatch");MOD:SetGroupFrame("raidpet")end,
 						},
 						size = {
 							type = "range",
@@ -673,8 +673,8 @@ SV.Options.args.SVUnit.args.raidpet ={
 							min = 4,
 							max = 15,
 							step = 1,
-							get = function(l)return SV.db.SVUnit["raid" .. w].auraWatch.size end,
-							set = function(l, m)MOD:ChangeDBVar(m, "size", "raid" .. w, "auraWatch");MOD:SetGroupFrame("raid" .. w)end,
+							get = function(l)return SV.db.SVUnit["raidpet"].auraWatch.size end,
+							set = function(l, m)MOD:ChangeDBVar(m, "size", "raidpet", "auraWatch");MOD:SetGroupFrame("raidpet")end,
 						},
 						configureButton ={
 							type = 'execute',
diff --git a/Interface/AddOns/SVUI_CraftOMatic/components/cooking.lua b/Interface/AddOns/SVUI_CraftOMatic/components/cooking.lua
index 749480d..29b42ae 100644
--- a/Interface/AddOns/SVUI_CraftOMatic/components/cooking.lua
+++ b/Interface/AddOns/SVUI_CraftOMatic/components/cooking.lua
@@ -27,6 +27,7 @@ local table 	= _G.table;
 local rept      = string.rep;
 local tsort,twipe = table.sort,table.wipe;
 local floor,ceil  = math.floor, math.ceil;
+local band 		= _G.bit.band;
 --[[
 ##########################################################
 GET ADDON DATA
@@ -101,12 +102,13 @@ EVENT HANDLER
 ]]--
 local EnableListener, DisableListener
 do
+	local proxyTest = false;
 	local CookEventHandler = CreateFrame("Frame")
 	local LootProxy = function(item, name)
 		if(item) then
 			local mask = [[0x10000]];
 			local itemType = GetItemFamily(item);
-			local pass = bit.band(itemType, mask);
+			local pass = band(itemType, mask);
 			if pass > 0 then
 				proxyTest = true;
 			end
diff --git a/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua b/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua
index f52d192..7d37633 100644
--- a/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua
+++ b/Interface/AddOns/SVUI_CraftOMatic/components/farming.lua
@@ -18,10 +18,30 @@ LOCALIZED LUA FUNCTIONS
 ]]--
 --[[ GLOBALS ]]--
 local _G = _G;
-local unpack 	= _G.unpack;
-local select 	= _G.select;
-local type 		= _G.type;
-local string    = _G.string;
+local unpack        = _G.unpack;
+local select        = _G.select;
+local assert        = _G.assert;
+local type          = _G.type;
+local error         = _G.error;
+local pcall         = _G.pcall;
+local print         = _G.print;
+local ipairs        = _G.ipairs;
+local pairs         = _G.pairs;
+local next          = _G.next;
+local rawset        = _G.rawset;
+local rawget        = _G.rawget;
+local tostring      = _G.tostring;
+local tonumber      = _G.tonumber;
+local getmetatable  = _G.getmetatable;
+local setmetatable  = _G.setmetatable;
+--STRING
+local string        = _G.string;
+local upper         = string.upper;
+local format        = string.format;
+local find          = string.find;
+local match         = string.match;
+local gsub          = string.gsub;
+
 local math 		= _G.math;
 local table 	= _G.table;
 local rept      = string.rep;
diff --git a/Interface/AddOns/SVUI_CraftOMatic/components/fishing.lua b/Interface/AddOns/SVUI_CraftOMatic/components/fishing.lua
index 995b328..d802e80 100644
--- a/Interface/AddOns/SVUI_CraftOMatic/components/fishing.lua
+++ b/Interface/AddOns/SVUI_CraftOMatic/components/fishing.lua
@@ -18,15 +18,35 @@ LOCALIZED LUA FUNCTIONS
 ]]--
 --[[ GLOBALS ]]--
 local _G = _G;
-local unpack 	= _G.unpack;
-local select 	= _G.select;
-local type 		= _G.type;
-local string    = _G.string;
+local unpack        = _G.unpack;
+local select        = _G.select;
+local assert        = _G.assert;
+local type          = _G.type;
+local error         = _G.error;
+local pcall         = _G.pcall;
+local print         = _G.print;
+local ipairs        = _G.ipairs;
+local pairs         = _G.pairs;
+local next          = _G.next;
+local rawset        = _G.rawset;
+local rawget        = _G.rawget;
+local tostring      = _G.tostring;
+local tonumber      = _G.tonumber;
+local getmetatable  = _G.getmetatable;
+local setmetatable  = _G.setmetatable;
+--STRING
+local string        = _G.string;
+local upper         = string.upper;
+local format        = string.format;
+local find          = string.find;
+local match         = string.match;
+local gsub          = string.gsub;
+local rept      = string.rep;
 local math 		= _G.math;
 local table 	= _G.table;
-local rept      = string.rep;
 local tsort,twipe = table.sort,table.wipe;
 local floor,ceil  = math.floor, math.ceil;
+local band 		= _G.bit.band;
 --[[
 ##########################################################
 GET ADDON DATA
@@ -202,7 +222,7 @@ local function LootProxy(item, name)
 	if(item) then
 		local mask = [[0x100000]];
 		local itemType = GetItemFamily(item);
-		local pass = bit.band(itemType, mask);
+		local pass = band(itemType, mask);
 		if pass > 0 then
 			proxyTest = true;
 		end
@@ -242,7 +262,7 @@ do
 		if(item) then
 			local mask = [[0x10000]];
 			local itemType = GetItemFamily(item);
-			local pass = bit.band(itemType, mask);
+			local pass = band(itemType, mask);
 			if pass > 0 then
 				proxyTest = true;
 			end
diff --git a/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua
index e726c62..22fc309 100644
--- a/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua
+++ b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua
@@ -38,9 +38,9 @@ local bit       = _G.bit;
 --[[ STRING METHODS ]]--
 local format, sub = string.format, string.sub;
 --[[ MATH METHODS ]]--
-local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round;
+local abs, ceil, floor, round, random = math.abs, math.ceil, math.floor, math.round, math.random;
 --[[ TABLE METHODS ]]--
-local tremove, twipe = table.remove, table.wipe;
+local tremove, wipe = table.remove, table.wipe;
 --[[ BINARY METHODS ]]--
 local band, bor = bit.band, bit.bor;

@@ -593,7 +593,7 @@ local function ParseIncomingLog(timestamp, event, eGuid, eName, pGuid)
 	if(cached) then
 		if(needsUpdate) then
 			EnemyAlarm(eName, cached.class, cached.colors, kos)
-			cached.time = timeStamp
+			cached.time = timestamp
 		end

 		if(pGuid == playerGUID and not AlertedCache[eName]) then
diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua
index a8dfd52..bd7d1d6 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua
@@ -22,6 +22,9 @@ local unpack 	= _G.unpack;
 local select 	= _G.select;
 local pairs 	= _G.pairs;
 local type 		= _G.type;
+local tostring 	= _G.tostring;
+local print 	= _G.print;
+local pcall 	= _G.pcall;
 local tinsert 	= _G.tinsert;
 local string 	= _G.string;
 local math 		= _G.math;
@@ -32,6 +35,8 @@ local format,find = string.format, string.find;
 local floor = math.floor;
 --[[ TABLE METHODS ]]--
 local twipe, tcopy = table.wipe, table.copy;
+local IsAddOnLoaded = _G.IsAddOnLoaded;
+local LoadAddOn = _G.LoadAddOn;
 --[[
 ##########################################################
 GET ADDON DATA
@@ -373,7 +378,7 @@ function PLUGIN:Load()
 	alert.Accept.Text = alert.Accept:CreateFontString(nil, "OVERLAY");
 	alert.Accept.Text:SetFont(SV.Media.font.default, 10);
 	alert.Accept.Text:SetPoint('CENTER');
-	alert.Accept.Text:SetText(YES);
+	alert.Accept.Text:SetText(_G.YES);
 	alert.Close = CreateFrame('Button', nil, alert);
 	alert.Close:SetSize(70, 25);
 	alert.Close:SetPoint('LEFT', alert, 'BOTTOM', 10, 20);
@@ -381,7 +386,7 @@ function PLUGIN:Load()
 	alert.Close.Text = alert.Close:CreateFontString(nil, "OVERLAY");
 	alert.Close.Text:SetFont(SV.Media.font.default, 10);
 	alert.Close.Text:SetPoint('CENTER');
-	alert.Close.Text:SetText(NO);
+	alert.Close.Text:SetText(_G.NO);
 	alert.Accept:SetButtonTemplate();
 	alert.Close:SetButtonTemplate();
 	alert:Hide();
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Ace3.lua b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Ace3.lua
index 68fec6b..b01fd8b 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/addons/Ace3.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/addons/Ace3.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/achievement.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/achievement.lua
index 8f4ed77..6069bbc 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/achievement.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/achievement.lua
@@ -13,6 +13,18 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack        = _G.unpack;
+local select        = _G.select;
+local assert        = _G.assert;
+local type          = _G.type;
+local error         = _G.error;
+local pcall         = _G.pcall;
+local print         = _G.print;
+local ipairs        = _G.ipairs;
+local pairs         = _G.pairs;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
@@ -283,7 +295,7 @@ local function AchievementStyle()
 				track:RemoveTextures()
 				track:SetCheckboxTemplate(true)
 				track:ClearAllPoints()
-				track:Point("BOTTOMLEFT", d, "BOTTOMLEFT", -1, -3)
+				track:Point("BOTTOMLEFT", -1, -3)
 				track.ListParent = button

 				hooksecurefunc(track, "SetPoint", _hook_TrackingPoint)
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/alert.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/alert.lua
index 04dc87d..023d1a7 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/alert.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/alert.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/archeology.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/archeology.lua
index 251045e..a1c720e 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/archeology.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/archeology.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/auctionhouse.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/auctionhouse.lua
index f7e4f24..c5b0e72 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/auctionhouse.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/auctionhouse.lua
@@ -13,6 +13,12 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+local pairs   = _G.pairs;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/barbershop.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/barbershop.lua
index c2ad149..0fdde1f 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/barbershop.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/barbershop.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/battlefield.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/battlefield.lua
index 044ff6c..a44b939 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/battlefield.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/battlefield.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/blackmarket.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/blackmarket.lua
index 88bc2c6..21ff8b3 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/blackmarket.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/blackmarket.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/calendar.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/calendar.lua
index ba4091f..9a999ed 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/calendar.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/calendar.lua
@@ -13,6 +13,13 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+local ipairs        = _G.ipairs;
+local pairs         = _G.pairs;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
@@ -53,12 +60,6 @@ local function CalendarStyle()
 			cfframe:Width(155)
 			cfframe:SetPanelTemplate("Default")

-			local cftext = _G["CalendarFilterFrameText"]
-			if(cftext) then
-				cftext:ClearAllPoints()
-				cftext:SetPoint("RIGHT", cfbutton, "LEFT", -2, 0)
-			end
-
 			local cfbutton = _G["CalendarFilterButton"];
 			if(cfbutton) then
 				cfbutton:ClearAllPoints()
@@ -66,6 +67,12 @@ local function CalendarStyle()
 				STYLE:ApplyPaginationStyle(cfbutton, true)
 				cfframe.Panel:SetPoint("TOPLEFT", 20, 2)
 				cfframe.Panel:SetPoint("BOTTOMRIGHT", cfbutton, "BOTTOMRIGHT", 2, -2)
+
+				local cftext = _G["CalendarFilterFrameText"]
+				if(cftext) then
+					cftext:ClearAllPoints()
+					cftext:SetPoint("RIGHT", cfbutton, "LEFT", -2, 0)
+				end
 			end
 		end
 	end
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/challenges.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/challenges.lua
index bfcfe58..1ad71b2 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/challenges.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/challenges.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/character.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/character.lua
index ea9fc7c..5fa7f77 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/character.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/character.lua
@@ -13,6 +13,13 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+local ipairs  = _G.ipairs;
+local pairs   = _G.pairs;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/chat.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/chat.lua
index 5f11298..fa27245 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/chat.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/chat.lua
@@ -13,6 +13,18 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+local string 	= _G.string;
+local math 		= _G.math;
+local table 	= _G.table;
+--[[ STRING METHODS ]]--
+local format, join, gsub = string.format, string.join, string.gsub;
+--[[ MATH METHODS ]]--
+local ceil = math.ceil;  -- Basic
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
@@ -22,6 +34,9 @@ local Schema = STYLE.Schema;
 FRAME LISTS
 ##########################################################
 ]]--
+local CHAT_CONFIG_CHANNEL_LIST = _G.CHAT_CONFIG_CHANNEL_LIST;
+local CHANNELS = _G.CHANNELS;
+
 local ChatMenuList = {
 	"ChatMenu",
 	"EmoteMenu",
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/dressup.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/dressup.lua
index 0f6f3b5..df512dd 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/dressup.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/dressup.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/encounterjournal.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/encounterjournal.lua
index 3920bb7..e807a0a 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/encounterjournal.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/encounterjournal.lua
@@ -13,6 +13,13 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+local ipairs  = _G.ipairs;
+local pairs   = _G.pairs;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/friends.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/friends.lua
index 5c8c50f..bfa7b46 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/friends.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/friends.lua
@@ -13,6 +13,13 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+local ipairs  = _G.ipairs;
+local pairs   = _G.pairs;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/gossip.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/gossip.lua
index d45542a..d76c24a 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/gossip.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/gossip.lua
@@ -13,6 +13,13 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+local ipairs  = _G.ipairs;
+local pairs   = _G.pairs;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/guild.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/guild.lua
index 6d1c9c0..3a719a5 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/guild.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/guild.lua
@@ -13,6 +13,17 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  	= _G.unpack;
+local select  	= _G.select;
+local ipairs  	= _G.ipairs;
+local pairs   	= _G.pairs;
+local next    	= _G.next;
+local time 		= _G.time;
+local date 		= _G.date;
+local ceil, modf = math.ceil, math.modf;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
@@ -232,7 +243,7 @@ local function GuildBankStyle()
 		local f = GetCurrentGuildBankTab()
 		local e, g, h, i, j, k, l, m;
 		for b = 1, MAX_GUILDBANK_SLOTS_PER_TAB do
-			g = mod(b, NUM_SLOTS_PER_GUILDBANK_GROUP)
+			g = modf(b, NUM_SLOTS_PER_GUILDBANK_GROUP)
 			if g == 0 then
 				g = NUM_SLOTS_PER_GUILDBANK_GROUP
 			end
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/help.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/help.lua
index bf38890..9b05609 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/help.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/help.lua
@@ -13,6 +13,12 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+local tinsert = _G.tinsert;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/inspect.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/inspect.lua
index f0ed23f..8e41af9 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/inspect.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/inspect.lua
@@ -13,6 +13,13 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+local ipairs  = _G.ipairs;
+local pairs   = _G.pairs;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/itemsocketing.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/itemsocketing.lua
index b4c53f2..a81c81d 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/itemsocketing.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/itemsocketing.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/itemupgrade.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/itemupgrade.lua
index 86aab3e..d6d8d32 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/itemupgrade.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/itemupgrade.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/keybinding.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/keybinding.lua
index bd456a5..d7f88b7 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/keybinding.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/keybinding.lua
@@ -13,6 +13,13 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+local ipairs  = _G.ipairs;
+local pairs   = _G.pairs;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lfd.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lfd.lua
index 19859c9..bd04c57 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lfd.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lfd.lua
@@ -13,6 +13,13 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+local ipairs  = _G.ipairs;
+local pairs   = _G.pairs;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/loothistory.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/loothistory.lua
index 6294540..bd3809d 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/loothistory.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/loothistory.lua
@@ -13,6 +13,14 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+local math    = _G.math;
+--[[ MATH METHODS ]]--
+local ceil = math.ceil;  -- Basic
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
@@ -22,48 +30,93 @@ local Schema = STYLE.Schema;
 HELPERS
 ##########################################################
 ]]--
-local MissingLootFrame_OnShow = function()
-  local N = GetNumMissingLootItems()
-  for u = 1, N do
-    local O = _G["MissingLootFrameItem"..u]
-    local icon = O.icon;
-    STYLE:ApplyItemButtonStyle(O, true)
-    local g, f, y, P = GetMissingLootItemInfo(u)
-    local color = GetItemQualityColor(P) or 0,0,0,1
-    icon:SetTexture(g)
-    M:SetBackdropBorderColor(color)
+local MissingLootFrame_OnShow = function(self)
+  local numMissing = GetNumMissingLootItems()
+  for i = 1, numMissing do
+    local slot = _G["MissingLootFrameItem"..i]
+    local icon = slot.icon;
+    STYLE:ApplyItemButtonStyle(slot, true)
+    local texture, name, count, quality = GetMissingLootItemInfo(i);
+    local r,g,b,hex = GetItemQualityColor(quality)
+    if(not r) then
+      r,g,b = 0,0,0
+    end
+    icon:SetTexture(texture)
+    _G.MissingLootFrame:SetBackdropBorderColor(r,g,b)
   end
-  local Q = ceil(N/2)
-  MissingLootFrame:SetHeight(Q * 43 + 38 + MissingLootFrameLabel:GetHeight())
+  local calc = (ceil(numMissing * 0.5) * 43) + 38
+  _G.MissingLootFrame:SetHeight(calc + _G.MissingLootFrameLabel:GetHeight())
 end

-local LootHistoryFrame_OnUpdate = function(o)
-  local N = C_LootHistory.GetNumItems()
-  for u = 1, N do
-    local M = LootHistoryFrame.itemFrames[u]
-    if not M.isStyled then
-      local Icon = M.Icon:GetTexture()
-      M:RemoveTextures()
-      M.Icon:SetTexture(Icon)
-      M.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
-      M:SetFixedPanelTemplate("Button")
-      M.Panel:WrapOuter(M.Icon)
-      M.Icon:SetParent(M.Panel)
-      M.isStyled = true
+local LootHistoryFrame_OnUpdate = function(self)
+  local numItems = _G.C_LootHistory.GetNumItems()
+  for i = 1, numItems do
+    local frame = _G.LootHistoryFrame.itemFrames[i]
+    if not frame.isStyled then
+      local Icon = frame.Icon:GetTexture()
+      frame:RemoveTextures()
+      frame.Icon:SetTexture(Icon)
+      frame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
+
+      frame:SetFixedPanelTemplate("Button")
+      frame.Panel:WrapOuter(frame.Icon)
+      frame.Icon:SetParent(frame.Panel)
+
+      frame.isStyled = true
     end
   end
-end
+end
+
+local _hook_MasterLootFrame_OnShow = function()
+  local MasterLooterFrame = _G.MasterLooterFrame;
+  local item = MasterLooterFrame.Item;
+  local LootFrame = _G.LootFrame;
+  if item then
+    local icon = item.Icon;
+    local tex = icon:GetTexture()
+    local colors = ITEM_QUALITY_COLORS[LootFrame.selectedQuality]
+    item:RemoveTextures()
+    icon:SetTexture(tex)
+    icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
+    item:SetPanelTemplate("Pattern")
+    item.Panel:WrapOuter(icon)
+    item.Panel:SetBackdropBorderColor(colors.r, colors.g, colors.b)
+  end
+  for i = 1, MasterLooterFrame:GetNumChildren()do
+    local child = select(i, MasterLooterFrame:GetChildren())
+    if child and not child.isStyled and not child:GetName() then
+      if child:GetObjectType() == "Button" then
+        if child:GetPushedTexture() then
+          STYLE:ApplyCloseButtonStyle(child)
+        else
+          child:SetFixedPanelTemplate()
+          child:SetButtonTemplate()
+        end
+        child.isStyled = true
+      end
+    end
+  end
+end
 --[[
 ##########################################################
 LOOTHISTORY STYLER
 ##########################################################
 ]]--
 local function LootHistoryStyle()
-  LootHistoryFrame:SetFrameStrata('HIGH')
   if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.loot ~= true then return end
-  local M = MissingLootFrame;
-  M:RemoveTextures()
-  M:SetPanelTemplate("Pattern")
+
+  local MasterLooterFrame = _G.MasterLooterFrame;
+  local MissingLootFrame = _G.MissingLootFrame;
+  local LootHistoryFrame = _G.LootHistoryFrame;
+  local BonusRollFrame = _G.BonusRollFrame;
+  local MissingLootFramePassButton = _G.MissingLootFramePassButton;
+  local MissingLootFrame_OnShow = _G.MissingLootFrame_OnShow;
+
+  LootHistoryFrame:SetFrameStrata('HIGH')
+
+  MissingLootFrame:RemoveTextures()
+  MissingLootFrame:SetPanelTemplate("Pattern")
+
   STYLE:ApplyCloseButtonStyle(MissingLootFramePassButton)
   hooksecurefunc("MissingLootFrame_Show", MissingLootFrame_OnShow)
   LootHistoryFrame:RemoveTextures()
@@ -87,37 +140,13 @@ local function LootHistoryStyle()
   LootHistoryFrameScrollFrame:RemoveTextures()
   STYLE:ApplyScrollFrameStyle(LootHistoryFrameScrollFrameScrollBar)
   hooksecurefunc("LootHistoryFrame_FullUpdate", LootHistoryFrame_OnUpdate)
+
   MasterLooterFrame:RemoveTextures()
   MasterLooterFrame:SetFixedPanelTemplate()
   MasterLooterFrame:SetFrameStrata('FULLSCREEN_DIALOG')
-  hooksecurefunc("MasterLooterFrame_Show", function()
-    local J = MasterLooterFrame.Item;
-    if J then
-      local u = J.Icon;
-      local icon = u:GetTexture()
-      local S = ITEM_QUALITY_COLORS[LootFrame.selectedQuality]
-      J:RemoveTextures()
-      u:SetTexture(icon)
-      u:SetTexCoord(0.1, 0.9, 0.1, 0.9)
-      J:SetPanelTemplate("Pattern")
-      J.Panel:WrapOuter(u)
-      J.Panel:SetBackdropBorderColor(S.r, S.g, S.b)
-    end
-    for u = 1, MasterLooterFrame:GetNumChildren()do
-      local T = select(u, MasterLooterFrame:GetChildren())
-      if T and not T.isStyled and not T:GetName() then
-        if T:GetObjectType() == "Button" then
-          if T:GetPushedTexture() then
-            STYLE:ApplyCloseButtonStyle(T)
-          else
-            T:SetFixedPanelTemplate()
-            T:SetButtonTemplate()
-          end
-          T.isStyled = true
-        end
-      end
-    end
-  end)
+
+  hooksecurefunc("MasterLooterFrame_Show", _hook_MasterLootFrame_OnShow)
+
   BonusRollFrame:RemoveTextures()
   STYLE:ApplyAlertStyle(BonusRollFrame)
   BonusRollFrame.PromptFrame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lossofcontrol.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lossofcontrol.lua
index b96660e..82793a8 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lossofcontrol.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/lossofcontrol.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/macro.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/macro.lua
index 67f8299..b3eb9c1 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/macro.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/macro.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
@@ -34,34 +39,66 @@ MACRO UI STYLER
 ##########################################################
 ]]--
 local function MacroUIStyle()
-	if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.macro ~= true then return end
+	if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.macro ~= true then return end
+
+	local MacroFrame = _G.MacroFrame;
+	local MacroFrameCloseButton = _G.MacroFrameCloseButton;
+	local MacroButtonScrollFrameScrollBar = _G.MacroButtonScrollFrameScrollBar;
+	local MacroFrameScrollFrameScrollBar = _G.MacroFrameScrollFrameScrollBar;
+	local MacroPopupScrollFrameScrollBar = _G.MacroPopupScrollFrameScrollBar;
+
+	local MacroPopupScrollFrame = _G.MacroPopupScrollFrame;
+	local MacroPopupFrame = _G.MacroPopupFrame;
+	local MacroFrameSelectedMacroButton = _G.MacroFrameSelectedMacroButton;
+	local MacroFrameSelectedMacroButtonIcon = _G.MacroFrameSelectedMacroButtonIcon;
+
 	STYLE:ApplyCloseButtonStyle(MacroFrameCloseButton)
 	STYLE:ApplyScrollFrameStyle(MacroButtonScrollFrameScrollBar)
 	STYLE:ApplyScrollFrameStyle(MacroFrameScrollFrameScrollBar)
 	STYLE:ApplyScrollFrameStyle(MacroPopupScrollFrameScrollBar)
+
 	MacroFrame:Width(360)
-	for b = 1, #MacroButtonList do
-		_G[MacroButtonList[b]]:RemoveTextures()
-		_G[MacroButtonList[b]]:SetButtonTemplate()
+
+	for i = 1, #MacroButtonList do
+		local button = _G[MacroButtonList[i]]
+		if(button) then
+			button:RemoveTextures()
+			button:SetButtonTemplate()
+		end
 	end
-	for b = 1, #MacroButtonList2 do
-		local a1,p,a2,x,y = _G[MacroButtonList2[b]]:GetPoint()
-		_G[MacroButtonList2[b]]:SetPoint(a1,p,a2,x,-25)
+
+	for i = 1, #MacroButtonList2 do
+		local button = _G[MacroButtonList2[i]]
+		if(button) then
+			local a1,p,a2,x,y = button:GetPoint()
+			button:SetPoint(a1,p,a2,x,-25)
+		end
 	end
-	for b = 1, 2 do
-		tab = _G[format("MacroFrameTab%s", b)]
-		tab:Height(22)
+
+	local firstTab
+	for i = 1, 2 do
+		local tab = _G[("MacroFrameTab%d"):format(i)]
+		if(tab) then
+			tab:Height(22)
+			if(i == 1) then
+				tab:Point("TOPLEFT", MacroFrame, "TOPLEFT", 85, -39)
+				firstTab = tab
+			elseif(firstTab) then
+				tab:Point("LEFT", firstTab, "RIGHT", 4, 0)
+			end
+		end
 	end
-	MacroFrameTab1:Point("TOPLEFT", MacroFrame, "TOPLEFT", 85, -39)
-	MacroFrameTab2:Point("LEFT", MacroFrameTab1, "RIGHT", 4, 0)
+
 	MacroFrame:RemoveTextures()
 	MacroFrame:SetPanelTemplate("Action")
 	MacroFrame.Panel:SetPoint("BOTTOMRIGHT",MacroFrame,"BOTTOMRIGHT",0,-25)
 	MacroFrameText:SetFont(SV.Media.font.roboto, 10, "OUTLINE")
 	MacroFrameTextBackground:RemoveTextures()
 	MacroFrameTextBackground:SetBasicPanel()
+
 	MacroPopupFrame:RemoveTextures()
 	MacroPopupFrame:SetBasicPanel()
+
 	MacroPopupScrollFrame:RemoveTextures()
 	MacroPopupScrollFrame:SetPanelTemplate("Pattern")
 	MacroPopupScrollFrame.Panel:Point("TOPLEFT", 51, 2)
@@ -71,20 +108,25 @@ local function MacroUIStyle()
 	MacroPopupNameLeft:SetTexture(0,0,0,0)
 	MacroPopupNameMiddle:SetTexture(0,0,0,0)
 	MacroPopupNameRight:SetTexture(0,0,0,0)
+
 	MacroFrameInset:Die()
 	MacroEditButton:ClearAllPoints()
 	MacroEditButton:Point("BOTTOMLEFT", MacroFrameSelectedMacroButton, "BOTTOMRIGHT", 10, 0)
+
 	STYLE:ApplyScrollFrameStyle(MacroButtonScrollFrame)
+
 	MacroPopupFrame:HookScript("OnShow", function(c)
 		c:ClearAllPoints()
 		c:Point("TOPLEFT", MacroFrame, "TOPRIGHT", 5, -2)
 	end)
+
 	MacroFrameSelectedMacroButton:RemoveTextures()
 	MacroFrameSelectedMacroButton:SetSlotTemplate()
 	MacroFrameSelectedMacroButtonIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
 	MacroFrameSelectedMacroButtonIcon:FillInner()
 	MacroFrameCharLimitText:ClearAllPoints()
 	MacroFrameCharLimitText:Point("BOTTOM", MacroFrameTextBackground, -25, -35)
+
 	for b = 1, MAX_ACCOUNT_MACROS do
 		local d = _G["MacroButton"..b]
 		local e = _G["MacroButton"..b.."Icon"]
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/mailbox.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/mailbox.lua
index 972bf14..c05a651 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/mailbox.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/mailbox.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/merchant.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/merchant.lua
index ee68517..532e3bc 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/merchant.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/merchant.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petbattle.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petbattle.lua
index 807a9c5..87ddcda 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petbattle.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petbattle.lua
@@ -13,6 +13,14 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+local ipairs  = _G.ipairs;
+local pairs   = _G.pairs;
+local hooksecurefunc = _G.hooksecurefunc;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
@@ -25,6 +33,7 @@ HELPERS
 local PBAB_WIDTH = 382;
 local PBAB_HEIGHT = 72;
 local PetBattleActionBar = CreateFrame("Frame", "SVUI_PetBattleActionBar", UIParent)
+local ITEM_QUALITY_COLORS = _G.ITEM_QUALITY_COLORS;

 local function PetBattleButtonHelper(frame)
 	frame:SetPanelTemplate("Blackout")
@@ -37,7 +46,156 @@ local function PetBattleButtonHelper(frame)
 	if(frame.pushed) then frame.pushed:FillInner(frame.Panel) end
 	if(frame.hover) then frame.hover:FillInner(frame.Panel) end
 	frame:SetFrameStrata('LOW')
-end
+end
+
+local _hook_UpdateSpeedIndicators = function()
+	local frame = _G.PetBattleFrame;
+
+	if not frame.ActiveAlly.SpeedIcon:IsShown() and not frame.ActiveEnemy.SpeedIcon:IsShown() then
+		frame.ActiveAlly.FirstAttack:Hide()
+		frame.ActiveEnemy.FirstAttack:Hide()
+		return
+	end
+
+	frame.ActiveAlly.FirstAttack:Show()
+
+	if frame.ActiveAlly.SpeedIcon:IsShown() then
+		frame.ActiveAlly.FirstAttack:SetVertexColor(0, 1, 0, 1)
+	else
+		frame.ActiveAlly.FirstAttack:SetVertexColor(.8, 0, .3, 1)
+	end
+
+	frame.ActiveEnemy.FirstAttack:Show()
+
+	if frame.ActiveEnemy.SpeedIcon:IsShown() then
+		frame.ActiveEnemy.FirstAttack:SetVertexColor(0, 1, 0, 1)
+	else
+		frame.ActiveEnemy.FirstAttack:SetVertexColor(.8, 0, .3, 1)
+	end
+end
+
+local _hook_UpdatePetType = function(self)
+	if self.PetType then
+		local C_PetBattles = _G.C_PetBattles;
+		local pettype = C_PetBattles.GetPetType(self.petOwner, self.petIndex)
+		if self.PetTypeFrame then
+			local text = _G.PET_TYPE_SUFFIX[pettype]
+			self.PetTypeFrame.text:SetText(text)
+		end
+	end
+end
+
+local _hook_AuraHolderUpdate = function(self)
+    if ( not self.petOwner or not self.petIndex ) then
+        self:Hide();
+        return;
+    end
+
+    local nextFrame = 1;
+    local C_PetBattles = _G.C_PetBattles;
+    for i=1, C_PetBattles.GetNumAuras(self.petOwner, self.petIndex) do
+        local auraID, instanceID, turnsRemaining, isBuff = C_PetBattles.GetAuraInfo(self.petOwner, self.petIndex, i);
+        if ( (isBuff and self.displayBuffs) or (not isBuff and self.displayDebuffs) ) then
+			local frame = self.frames[nextFrame]
+			frame.DebuffBorder:Hide()
+			if not frame.isStyled then
+				frame:SetSlotTemplate(true, 2, -8,-2)
+				frame.Icon:FillInner(frame.Panel, 2, 2)
+				frame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
+				frame.isStyled = true
+			end
+			if isBuff then
+				frame:SetBackdropBorderColor(0, 1, 0)
+			else
+				frame:SetBackdropBorderColor(1, 0, 0)
+			end
+			frame.Duration:SetFont(SV.Media.font.numbers, 16, "OUTLINE")
+			frame.Duration:ClearAllPoints()
+			frame.Duration:SetPoint("BOTTOMLEFT", frame.Icon, "BOTTOMLEFT", 4, 4)
+			if turnsRemaining > 0 then
+				frame.Duration:SetText(turnsRemaining)
+			end
+			nextFrame = nextFrame + 1
+		end
+	end
+end
+
+local _hook_WeatherFrameUpdate = function(self)
+	local LE_BATTLE_PET_WEATHER = _G.LE_BATTLE_PET_WEATHER;
+	local PET_BATTLE_PAD_INDEX = _G.PET_BATTLE_PAD_INDEX;
+	local C_PetBattles = _G.C_PetBattles;
+	local auraID = C_PetBattles.GetAuraInfo(LE_BATTLE_PET_WEATHER, PET_BATTLE_PAD_INDEX, 1)
+	if auraID then
+		self.Icon:Hide()
+		self.Name:Hide()
+		self.DurationShadow:Hide()
+		self.Label:Hide()
+		self.Duration:SetPoint("CENTER", self, 0, 8)
+		self:ClearAllPoints()
+		self:SetPoint("TOP", SV.UIParent, 0, -15)
+	end
+end
+
+local _hook_UpdateDisplay = function(self)
+	self.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
+	--Update the pet rarity border
+    if (self.IconBackdrop) then
+    	local petOwner = self.petOwner;
+		local petIndex = self.petIndex;
+        local rarity = _G.C_PetBattles.GetBreedQuality(petOwner, petIndex);
+        if (_G.ENABLE_COLORBLIND_MODE ~= "1") then
+        	self.IconBackdrop:SetBackdropColor(ITEM_QUALITY_COLORS[rarity-1].r, ITEM_QUALITY_COLORS[rarity-1].g, ITEM_QUALITY_COLORS[rarity-1].b);
+            self.IconBackdrop:SetBackdropBorderColor(ITEM_QUALITY_COLORS[rarity-1].r, ITEM_QUALITY_COLORS[rarity-1].g, ITEM_QUALITY_COLORS[rarity-1].b);
+        end
+    end
+end
+
+local _hook_AbilityTooltipShow = function()
+	SV:AnchorToCursor(PetBattlePrimaryAbilityTooltip)
+end
+
+local _hook_SkipButtonSetPoint = function(self, arg1, _, arg2, arg3, arg4)
+	if (arg1 ~= "BOTTOMLEFT" or arg2 ~= "TOPLEFT" or arg3 ~= 2 or arg4 ~= 2) then
+		self:ClearAllPoints()
+		self:SetPoint("BOTTOMLEFT", PetBattleActionBar.Panel, "TOPLEFT", 2, 2)
+	end
+end
+
+local _hook_PetSelectionFrameShow = function()
+	local frame = _G.PetBattleFrame;
+	if(frame and frame.BottomFrame) then
+		frame.BottomFrame.PetSelectionFrame:ClearAllPoints()
+		frame.BottomFrame.PetSelectionFrame:SetPoint("BOTTOM", frame.BottomFrame.xpBar, "TOP", 0, 8)
+	end
+end
+
+local _hook_UpdateActionBarLayout = function(self)
+	local list = _G.NUM_BATTLE_PET_ABILITIES;
+	for i = 1, list do
+		local actionButton = self.BottomFrame.abilityButtons[i]
+		PetBattleButtonHelper(actionButton)
+		actionButton:SetParent(PetBattleActionBar)
+		actionButton:ClearAllPoints()
+		if i == 1 then
+			actionButton:SetPoint("BOTTOMLEFT", 10, 10)
+		else
+			local lastActionButton = self.BottomFrame.abilityButtons[i - 1]
+			actionButton:SetPoint("LEFT", lastActionButton, "RIGHT", 10, 0)
+		end
+	end
+	self.BottomFrame.SwitchPetButton:SetParent(PetBattleActionBar)
+	self.BottomFrame.SwitchPetButton:ClearAllPoints()
+	self.BottomFrame.SwitchPetButton:SetPoint("LEFT", self.BottomFrame.abilityButtons[3], "RIGHT", 10, 0)
+	PetBattleButtonHelper(self.BottomFrame.SwitchPetButton)
+	self.BottomFrame.CatchButton:SetParent(PetBattleActionBar)
+	self.BottomFrame.CatchButton:ClearAllPoints()
+	self.BottomFrame.CatchButton:SetPoint("LEFT", self.BottomFrame.SwitchPetButton, "RIGHT", 10, 0)
+	PetBattleButtonHelper(self.BottomFrame.CatchButton)
+	self.BottomFrame.ForfeitButton:SetParent(PetBattleActionBar)
+	self.BottomFrame.ForfeitButton:ClearAllPoints()
+	self.BottomFrame.ForfeitButton:SetPoint("LEFT", self.BottomFrame.CatchButton, "RIGHT", 10, 0)
+	PetBattleButtonHelper(self.BottomFrame.ForfeitButton)
+end
 --[[
 ##########################################################
 PETBATTLE STYLER
@@ -48,7 +206,7 @@ local function PetBattleStyle()
 		return
 	end

-	local PetBattleFrame = _G["PetBattleFrame"];
+	local PetBattleFrame = _G.PetBattleFrame;
 	local BottomFrame = PetBattleFrame.BottomFrame;
 	local ActiveFramesList = { PetBattleFrame.ActiveAlly, PetBattleFrame.ActiveEnemy }
 	local StandardFramesList = { PetBattleFrame.Ally2, PetBattleFrame.Ally3, PetBattleFrame.Enemy2, PetBattleFrame.Enemy3 }
@@ -171,6 +329,7 @@ local function PetBattleStyle()
 	PetBattleActionBar:SetFrameStrata('BACKGROUND')
 	PetBattleActionBar:SetFixedPanelTemplate("Blackout")

+	local SuperDockBottomDataAnchor = _G.SuperDockBottomDataAnchor;
 	if(SuperDockBottomDataAnchor) then
 		PetBattleActionBar:SetPoint("BOTTOM", SuperDockBottomDataAnchor, "TOP", 0, 4)
 	else
@@ -229,6 +388,8 @@ local function PetBattleStyle()
 		pet.HealthText:SetAlpha(0)
 	end

+	local PetBattleQueueReadyFrame = _G.PetBattleQueueReadyFrame;
+
 	PetBattleQueueReadyFrame:RemoveTextures()
 	PetBattleQueueReadyFrame:SetBasicPanel()
 	PetBattleQueueReadyFrame.AcceptButton:SetButtonTemplate()
@@ -236,138 +397,15 @@ local function PetBattleStyle()
 	PetBattleQueueReadyFrame.Art:SetTexture([[Interface\PetBattles\PetBattlesQueue]])

 	--[[ TOO MANY GOD DAMN HOOKS ]]--
-	hooksecurefunc("PetBattleFrame_UpdateSpeedIndicators", function()
-		if not PetBattleFrame.ActiveAlly.SpeedIcon:IsShown() and not PetBattleFrame.ActiveEnemy.SpeedIcon:IsShown() then
-			PetBattleFrame.ActiveAlly.FirstAttack:Hide()
-			PetBattleFrame.ActiveEnemy.FirstAttack:Hide()
-			return
-		end
-		PetBattleFrame.ActiveAlly.FirstAttack:Show()
-		if PetBattleFrame.ActiveAlly.SpeedIcon:IsShown() then
-			PetBattleFrame.ActiveAlly.FirstAttack:SetVertexColor(0, 1, 0, 1)
-		else
-			PetBattleFrame.ActiveAlly.FirstAttack:SetVertexColor(.8, 0, .3, 1)
-		end
-		PetBattleFrame.ActiveEnemy.FirstAttack:Show()
-		if PetBattleFrame.ActiveEnemy.SpeedIcon:IsShown() then
-			PetBattleFrame.ActiveEnemy.FirstAttack:SetVertexColor(0, 1, 0, 1)
-		else
-			PetBattleFrame.ActiveEnemy.FirstAttack:SetVertexColor(.8, 0, .3, 1)
-		end
-	end)
-
-	hooksecurefunc("PetBattleUnitFrame_UpdatePetType", function(self)
-		if self.PetType then
-			local pettype = C_PetBattles.GetPetType(self.petOwner, self.petIndex)
-			if self.PetTypeFrame then
-				self.PetTypeFrame.text:SetText(PET_TYPE_SUFFIX[pettype])
-			end
-		end
-	end)
-
-	hooksecurefunc("PetBattleAuraHolder_Update", function(self)
-	    if ( not self.petOwner or not self.petIndex ) then
-	        self:Hide();
-	        return;
-	    end
-
-	    local nextFrame = 1;
-	    for i=1, C_PetBattles.GetNumAuras(self.petOwner, self.petIndex) do
-	        local auraID, instanceID, turnsRemaining, isBuff = C_PetBattles.GetAuraInfo(self.petOwner, self.petIndex, i);
-	        if ( (isBuff and self.displayBuffs) or (not isBuff and self.displayDebuffs) ) then
-				local frame = self.frames[nextFrame]
-				frame.DebuffBorder:Hide()
-				if not frame.isStyled then
-					frame:SetSlotTemplate(true, 2, -8,-2)
-					frame.Icon:FillInner(frame.Panel, 2, 2)
-					frame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
-					frame.isStyled = true
-				end
-				if isBuff then
-					frame:SetBackdropBorderColor(0, 1, 0)
-				else
-					frame:SetBackdropBorderColor(1, 0, 0)
-				end
-				frame.Duration:SetFont(SV.Media.font.numbers, 16, "OUTLINE")
-				frame.Duration:ClearAllPoints()
-				frame.Duration:SetPoint("BOTTOMLEFT", frame.Icon, "BOTTOMLEFT", 4, 4)
-				if turnsRemaining > 0 then
-					frame.Duration:SetText(turnsRemaining)
-				end
-				nextFrame = nextFrame + 1
-			end
-		end
-	end)
-
-	hooksecurefunc("PetBattleWeatherFrame_Update", function(self)
-		local auraID = C_PetBattles.GetAuraInfo(LE_BATTLE_PET_WEATHER, PET_BATTLE_PAD_INDEX, 1)
-		if auraID then
-			self.Icon:Hide()
-			self.Name:Hide()
-			self.DurationShadow:Hide()
-			self.Label:Hide()
-			self.Duration:SetPoint("CENTER", self, 0, 8)
-			self:ClearAllPoints()
-			self:SetPoint("TOP", SV.UIParent, 0, -15)
-		end
-	end)
-
-	hooksecurefunc("PetBattleUnitFrame_UpdateDisplay", function(self)
-		self.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
-		--Update the pet rarity border
-	    if (self.IconBackdrop) then
-	    	local petOwner = self.petOwner;
-    		local petIndex = self.petIndex;
-	        local rarity = C_PetBattles.GetBreedQuality(petOwner, petIndex);
-	        if (ENABLE_COLORBLIND_MODE ~= "1") then
-	        	self.IconBackdrop:SetBackdropColor(ITEM_QUALITY_COLORS[rarity-1].r, ITEM_QUALITY_COLORS[rarity-1].g, ITEM_QUALITY_COLORS[rarity-1].b);
-	            self.IconBackdrop:SetBackdropBorderColor(ITEM_QUALITY_COLORS[rarity-1].r, ITEM_QUALITY_COLORS[rarity-1].g, ITEM_QUALITY_COLORS[rarity-1].b);
-	        end
-	    end
-	end)
-
-	hooksecurefunc("PetBattleAbilityTooltip_Show", function()
-		SV:AnchorToCursor(PetBattlePrimaryAbilityTooltip)
-	end)
-
-	hooksecurefunc(BottomFrame.TurnTimer.SkipButton, "SetPoint", function(self, arg1, _, arg2, arg3, arg4)
-		if (arg1 ~= "BOTTOMLEFT" or arg2 ~= "TOPLEFT" or arg3 ~= 2 or arg4 ~= 2) then
-			self:ClearAllPoints()
-			self:SetPoint("BOTTOMLEFT", PetBattleActionBar.Panel, "TOPLEFT", 2, 2)
-		end
-	end)
-
-	hooksecurefunc("PetBattlePetSelectionFrame_Show", function()
-		BottomFrame.PetSelectionFrame:ClearAllPoints()
-		BottomFrame.PetSelectionFrame:SetPoint("BOTTOM", BottomFrame.xpBar, "TOP", 0, 8)
-	end)
-
-	hooksecurefunc("PetBattleFrame_UpdateActionBarLayout", function(self)
-		for i = 1, NUM_BATTLE_PET_ABILITIES do
-			local actionButton = self.BottomFrame.abilityButtons[i]
-			PetBattleButtonHelper(actionButton)
-			actionButton:SetParent(PetBattleActionBar)
-			actionButton:ClearAllPoints()
-			if i == 1 then
-				actionButton:SetPoint("BOTTOMLEFT", 10, 10)
-			else
-				local lastActionButton = self.BottomFrame.abilityButtons[i - 1]
-				actionButton:SetPoint("LEFT", lastActionButton, "RIGHT", 10, 0)
-			end
-		end
-		self.BottomFrame.SwitchPetButton:SetParent(PetBattleActionBar)
-		self.BottomFrame.SwitchPetButton:ClearAllPoints()
-		self.BottomFrame.SwitchPetButton:SetPoint("LEFT", self.BottomFrame.abilityButtons[3], "RIGHT", 10, 0)
-		PetBattleButtonHelper(self.BottomFrame.SwitchPetButton)
-		self.BottomFrame.CatchButton:SetParent(PetBattleActionBar)
-		self.BottomFrame.CatchButton:ClearAllPoints()
-		self.BottomFrame.CatchButton:SetPoint("LEFT", self.BottomFrame.SwitchPetButton, "RIGHT", 10, 0)
-		PetBattleButtonHelper(self.BottomFrame.CatchButton)
-		self.BottomFrame.ForfeitButton:SetParent(PetBattleActionBar)
-		self.BottomFrame.ForfeitButton:ClearAllPoints()
-		self.BottomFrame.ForfeitButton:SetPoint("LEFT", self.BottomFrame.CatchButton, "RIGHT", 10, 0)
-		PetBattleButtonHelper(self.BottomFrame.ForfeitButton)
-	end)
+	hooksecurefunc("PetBattleFrame_UpdateSpeedIndicators", _hook_UpdateSpeedIndicators)
+	hooksecurefunc("PetBattleUnitFrame_UpdatePetType", _hook_UpdatePetType)
+	hooksecurefunc("PetBattleAuraHolder_Update", _hook_AuraHolderUpdate)
+	hooksecurefunc("PetBattleWeatherFrame_Update", _hook_WeatherFrameUpdate)
+	hooksecurefunc("PetBattleUnitFrame_UpdateDisplay", _hook_UpdateDisplay)
+	hooksecurefunc("PetBattleAbilityTooltip_Show", _hook_AbilityTooltipShow)
+	hooksecurefunc(BottomFrame.TurnTimer.SkipButton, "SetPoint", _hook_SkipButtonSetPoint)
+	hooksecurefunc("PetBattlePetSelectionFrame_Show", _hook_PetSelectionFrameShow)
+	hooksecurefunc("PetBattleFrame_UpdateActionBarLayout", _hook_UpdateActionBarLayout)

 	SV.SVTip:ReLoad()
 end
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petition.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petition.lua
index ec4aecb..94233ab 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petition.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petition.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petjournal.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petjournal.lua
index fac1626..d4695d4 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petjournal.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petjournal.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petstable.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petstable.lua
index e296f8e..c874d6e 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petstable.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/petstable.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/pvp.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/pvp.lua
index f7d643e..b513809 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/pvp.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/pvp.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
@@ -22,13 +27,33 @@ local Schema = STYLE.Schema;
 PVP STYLER
 ##########################################################
 ]]--
--- LoadAddOn("Blizzard_PVPUI")
+local _hook_PVPReadyDialogDisplay = function(self, _, _, _, queueType, _, queueRole)
+	if(queueRole == "DAMAGER") then
+		local coords = _G.LFDQueueFrameRoleButtonDPS.background:GetTexCoord()
+		_G.PVPReadyDialogRoleIcon.texture:SetTexCoord(coords)
+	elseif(queueRole == "TANK") then
+		local coords = _G.LFDQueueFrameRoleButtonTank.background:GetTexCoord()
+		_G.PVPReadyDialogRoleIcon.texture:SetTexCoord(coords)
+	elseif(queueRole == "HEALER") then
+		local coords = _G.LFDQueueFrameRoleButtonHealer.background:GetTexCoord()
+		_G.PVPReadyDialogRoleIcon.texture:SetTexCoord(coords)
+	end
+	if(queueType == "ARENA") then
+		self:SetHeight(100)
+	end
+end

 local function PVPFrameStyle()
 	if (SV.db[Schema] and (SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.pvp ~= true)) then
 		return
 	end

+	local HonorFrame = _G.HonorFrame;
+	local ConquestFrame = _G.ConquestFrame;
+	local PVPUIFrame = _G.PVPUIFrame;
+	local WarGamesFrame = _G.WarGamesFrame;
+	local PVPReadyDialog = _G.PVPReadyDialog;
+
 	STYLE:ApplyWindowStyle(PVPUIFrame, true)

 	STYLE:ApplyCloseButtonStyle(PVPUIFrameCloseButton)
@@ -102,6 +127,8 @@ local function PVPFrameStyle()
 		end
 	end)

+	local ConquestPointsBar = _G.ConquestPointsBar;
+
 	ConquestFrame.Inset:RemoveTextures()
 	ConquestPointsBarLeft:Die()
 	ConquestPointsBarRight:Die()
@@ -141,18 +168,7 @@ local function PVPFrameStyle()
 	ConquestFrame.Inset:SetFixedPanelTemplate("Inset")
 	WarGamesFrameScrollFrame:SetPanelTemplate("Inset",false,2,2,6)

-	hooksecurefunc("PVPReadyDialog_Display", function(self, l, N, O, P, Q, R)
-		if R == "DAMAGER" then
-			PVPReadyDialogRoleIcon.texture:SetTexCoord(LFDQueueFrameRoleButtonDPS.background:GetTexCoord())
-		elseif R == "TANK" then
-			PVPReadyDialogRoleIcon.texture:SetTexCoord(LFDQueueFrameRoleButtonTank.background:GetTexCoord())
-		elseif R == "HEALER" then
-			PVPReadyDialogRoleIcon.texture:SetTexCoord(LFDQueueFrameRoleButtonHealer.background:GetTexCoord())
-		end
-		if P == "ARENA" then
-			self:SetHeight(100)
-		end
-	end)
+	hooksecurefunc("PVPReadyDialog_Display", _hook_PVPReadyDialogDisplay)
 end
 --[[
 ##########################################################
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/quest.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/quest.lua
index 8e2ceb7..665ad9d 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/quest.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/quest.lua
@@ -15,6 +15,13 @@ S U P E R - V I L L A I N - U I   By: Munglunch                              #
 credit: Elv.                      original logic from ElvUI. Adapted to SVUI #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+local ipairs  = _G.ipairs;
+local pairs   = _G.pairs;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
@@ -46,6 +53,8 @@ local function QuestScrollHelper(b, c, d, e)
 end

 local function QueuedWatchFrameItems()
+	local WATCHFRAME_NUM_ITEMS = _G.WATCHFRAME_NUM_ITEMS
+	if(not WATCHFRAME_NUM_ITEMS) then return end;
 	for i=1, WATCHFRAME_NUM_ITEMS do
 		local button = _G["WatchFrameItem"..i]
 		local point, relativeTo, relativePoint, xOffset, yOffset = button:GetPoint(1)
@@ -75,6 +84,8 @@ local QuestRewardScrollFrame_OnShow = function(self)
 end

 local Hook_QuestInfo_Display = function(self, ...)
+	local MAX_NUM_ITEMS = _G.MAX_NUM_ITEMS
+	if(not MAX_NUM_ITEMS) then return end;
 	for i = 1, MAX_NUM_ITEMS do
 		local name = ("QuestInfoItem%d"):format(i)
 		local item = _G[name]
@@ -92,13 +103,43 @@ local Hook_QuestInfo_Display = function(self, ...)
 end

 local Hook_QuestInfoItem_OnClick = function(self)
-	QuestInfoItemHighlight:ClearAllPoints()
-	QuestInfoItemHighlight:SetAllPoints(self)
+	_G.QuestInfoItemHighlight:ClearAllPoints()
+	_G.QuestInfoItemHighlight:SetAllPoints(self)
 end

 local Hook_QuestNPCModel = function(self, _, _, _, x, y)
-	QuestNPCModel:ClearAllPoints()
-	QuestNPCModel:SetPoint("TOPLEFT", self, "TOPRIGHT", x + 18, y)
+	_G.QuestNPCModel:ClearAllPoints()
+	_G.QuestNPCModel:SetPoint("TOPLEFT", self, "TOPRIGHT", x + 18, y)
+end
+
+local _hook_GreetingPanelShow = function(self)
+	self:RemoveTextures()
+
+	_G.QuestFrameGreetingGoodbyeButton:SetButtonTemplate()
+	_G.QuestGreetingFrameHorizontalBreak:Die()
+end
+
+local _hook_DetailScrollShow = function(self)
+	if not self.Panel then
+		self:SetPanelTemplate("Default")
+		QuestScrollHelper(self, 509, 630, false)
+	end
+	self.spellTex:Height(self:GetHeight() + 217)
+end
+
+local _hook_QuestLogFrameShow = function(self)
+	local QuestLogScrollFrame = _G.QuestLogScrollFrame;
+	if not QuestLogScrollFrame.spellTex then
+		QuestLogScrollFrame:SetFixedPanelTemplate("Default")
+		QuestLogScrollFrame.spellTex = QuestLogScrollFrame:CreateTexture(nil, 'ARTWORK')
+		QuestLogScrollFrame.spellTex:SetTexture([[Interface\QuestFrame\QuestBookBG]])
+		QuestLogScrollFrame.spellTex:SetPoint("TOPLEFT", 2, -2)
+		QuestLogScrollFrame.spellTex:Size(514, 616)
+		QuestLogScrollFrame.spellTex:SetTexCoord(0, 1, 0.02, 1)
+		QuestLogScrollFrame.spellTex2 = QuestLogScrollFrame:CreateTexture(nil, 'BORDER')
+		QuestLogScrollFrame.spellTex2:SetTexture([[Interface\FrameGeneral\UI-Background-Rock]])
+		QuestLogScrollFrame.spellTex2:FillInner()
+	end
 end
 --[[
 ##########################################################
@@ -109,12 +150,7 @@ local function QuestGreetingStyle()
 	if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.greeting ~= true then
 		return
 	end
-
-	QuestFrameGreetingPanel:HookScript("OnShow", function()
-		QuestFrameGreetingPanel:RemoveTextures()
-		QuestFrameGreetingGoodbyeButton:SetButtonTemplate()
-		QuestGreetingFrameHorizontalBreak:Die()
-	end)
+	_G.QuestFrameGreetingPanel:HookScript("OnShow", _hook_GreetingPanelShow)
 end

 local function QuestFrameStyle()
@@ -148,29 +184,8 @@ local function QuestFrameStyle()

 		QuestLogFramePushQuestButton:Point("LEFT", QuestLogFrameAbandonButton, "RIGHT", 2, 0)
 		QuestLogFramePushQuestButton:Point("RIGHT", QuestLogFrameTrackButton, "LEFT", -2, 0)
-
-		QuestLogDetailScrollFrame:HookScript('OnShow', function(k)
-			if not QuestLogDetailScrollFrame.Panel then
-				QuestLogDetailScrollFrame:SetPanelTemplate("Default")
-				QuestScrollHelper(QuestLogDetailScrollFrame, 509, 630, false)
-				QuestLogDetailScrollFrame:Height(k:GetHeight() - 2)
-			end
-			QuestLogDetailScrollFrame.spellTex:Height(k:GetHeight() + 217)
-		end)
-
-		QuestLogFrame:HookScript("OnShow", function()
-			if not QuestLogScrollFrame.spellTex then
-				QuestLogScrollFrame:SetFixedPanelTemplate("Default")
-				QuestLogScrollFrame.spellTex = QuestLogScrollFrame:CreateTexture(nil, 'ARTWORK')
-				QuestLogScrollFrame.spellTex:SetTexture([[Interface\QuestFrame\QuestBookBG]])
-				QuestLogScrollFrame.spellTex:SetPoint("TOPLEFT", 2, -2)
-				QuestLogScrollFrame.spellTex:Size(514, 616)
-				QuestLogScrollFrame.spellTex:SetTexCoord(0, 1, 0.02, 1)
-				QuestLogScrollFrame.spellTex2 = QuestLogScrollFrame:CreateTexture(nil, 'BORDER')
-				QuestLogScrollFrame.spellTex2:SetTexture([[Interface\FrameGeneral\UI-Background-Rock]])
-				QuestLogScrollFrame.spellTex2:FillInner()
-			end
-		end)
+		QuestLogDetailScrollFrame:HookScript('OnShow', _hook_DetailScrollShow)
+		QuestLogFrame:HookScript("OnShow", _hook_QuestLogFrameShow)
 	end
 	--[[ ############################### ]]--

diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/raid.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/raid.lua
index 05c420e..4679348 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/raid.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/raid.lua
@@ -13,6 +13,13 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+local ipairs  = _G.ipairs;
+local pairs   = _G.pairs;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/reforging.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/reforging.lua
index 6ea57b8..cf8d20c 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/reforging.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/reforging.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/spellbook.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/spellbook.lua
index ea1731a..b111159 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/spellbook.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/spellbook.lua
@@ -13,6 +13,13 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+local ipairs  = _G.ipairs;
+local pairs   = _G.pairs;
+
 local SV = _G["SVUI"];
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/store.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/store.lua
index d4c8056..c0ba879 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/store.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/store.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
@@ -28,7 +33,7 @@ local function StoreStyle()
 	-- end

 	--STYLE:ApplyWindowStyle(StoreFrame)
-	STYLE:ApplyTooltipStyle(StoreTooltip)
+	STYLE:ApplyTooltipStyle(_G.StoreTooltip)
 end
 --[[
 ##########################################################
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/system.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/system.lua
index 39f1ff1..dcac39d 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/system.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/system.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
@@ -382,10 +387,10 @@ local SystemFrameList21 = {
 HELPER FUNCTIONS
 ##########################################################
 ]]--
-local function forceBackdropColor(self, r, g, b, a)
+local _hook_GhostFrameBackdropColor = function(self, r, g, b, a)
 	if r ~= 0 or g ~= 0 or b ~= 0 or a ~= 0 then
-		GhostFrame:SetBackdropColor(0,0,0,0)
-		GhostFrame:SetBackdropBorderColor(0,0,0,0)
+		self:SetBackdropColor(0,0,0,0)
+		self:SetBackdropBorderColor(0,0,0,0)
 	end
 end
 --[[
@@ -396,6 +401,14 @@ SYSTEM WIDGET STYLERS
 local function SystemPanelQue()
 	if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.misc ~= true then return end

+	local GhostFrame = _G.GhostFrame;
+	local ReadyCheckFrame = _G.ReadyCheckFrame;
+	local InterfaceOptionsFrame = _G.InterfaceOptionsFrame;
+	local MacOptionsFrame = _G.MacOptionsFrame;
+	local GuildInviteFrame = _G.GuildInviteFrame;
+	local BattleTagInviteFrame = _G.BattleTagInviteFrame;
+	local SideDressUpFrame = _G.SideDressUpFrame;
+
 	QueueStatusFrame:RemoveTextures()

 	for i = 1, #SystemPopList do
@@ -456,12 +469,13 @@ local function SystemPanelQue()
 	if IsAddOnLoaded("OptionHouse") then
 		GameMenuButtonOptionHouse:SetButtonTemplate()
 	end
+
 	do
 		GhostFrame:SetButtonTemplate()
 		GhostFrame:SetBackdropColor(0,0,0,0)
 		GhostFrame:SetBackdropBorderColor(0,0,0,0)
-		hooksecurefunc(GhostFrame, "SetBackdropColor", forceBackdropColor)
-		hooksecurefunc(GhostFrame, "SetBackdropBorderColor", forceBackdropColor)
+		hooksecurefunc(GhostFrame, "SetBackdropColor", _hook_GhostFrameBackdropColor)
+		hooksecurefunc(GhostFrame, "SetBackdropBorderColor", _hook_GhostFrameBackdropColor)
 		GhostFrame:ClearAllPoints()
 		GhostFrame:SetPoint("TOP", SV.UIParent, "TOP", 0, -150)
 		GhostFrameContentsFrame:SetButtonTemplate()
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tabard.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tabard.lua
index 663f239..a371433 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tabard.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tabard.lua
@@ -13,6 +13,14 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  	= _G.unpack;
+local select  	= _G.select;
+local ipairs  	= _G.ipairs;
+local pairs   	= _G.pairs;
+local type 		= _G.type;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
@@ -64,24 +72,24 @@ local function TabardFrameStyle()
 		local c = "TabardFrameCustomization"..b;_G[c]:RemoveTextures()
 		STYLE:ApplyPaginationStyle(_G[c.."LeftButton"])
 		STYLE:ApplyPaginationStyle(_G[c.."RightButton"])
-		if b>1 then
+		if b > 1 then
 			 _G[c]:ClearAllPoints()
 			_G[c]:Point("TOP", _G["TabardFrameCustomization"..b-1], "BOTTOM", 0, -6)
 		else
 			local d, e, f, g, h = _G[c]:GetPoint()
-			_G[c]:Point(d, e, f, g, h+4)
+			_G[c]:Point(d, e, f, g, h + 4)
 		end
 	end
-	TabardCharacterModelRotateLeftButton:Point("BOTTOMLEFT", 4, 4)
-	TabardCharacterModelRotateRightButton:Point("TOPLEFT", TabardCharacterModelRotateLeftButton, "TOPRIGHT", 4, 0)
-	hooksecurefunc(TabardCharacterModelRotateLeftButton, "SetPoint", function(i, d, j, k, l, m)
-		if d ~= "BOTTOMLEFT"or l ~= 4 or m ~= 4 then
-			 i:Point("BOTTOMLEFT", 4, 4)
+	TabardCharacterModelRotateLeftButton:SetPoint("BOTTOMLEFT", 4, 4)
+	TabardCharacterModelRotateRightButton:SetPoint("TOPLEFT", TabardCharacterModelRotateLeftButton, "TOPRIGHT", 4, 0)
+	hooksecurefunc(TabardCharacterModelRotateLeftButton, "SetPoint", function(self, d, j, k, l, m)
+		if d ~= "BOTTOMLEFT" or l ~= 4 or m ~= 4 then
+			 self:SetPoint("BOTTOMLEFT", 4, 4)
 		end
 	end)
-	hooksecurefunc(TabardCharacterModelRotateRightButton, "SetPoint", function(i, d, j, k, l, m)
-		if d ~= "TOPLEFT"or l ~= 4 or m ~= 0 then
-			 i:Point("TOPLEFT", TabardCharacterModelRotateLeftButton, "TOPRIGHT", 4, 0)
+	hooksecurefunc(TabardCharacterModelRotateRightButton, "SetPoint", function(self, d, j, k, l, m)
+		if d ~= "TOPLEFT" or l ~= 4 or m ~= 0 then
+			 self:SetPoint("TOPLEFT", _G.TabardCharacterModelRotateLeftButton, "TOPRIGHT", 4, 0)
 		end
 	end)
 end
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/talents.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/talents.lua
index f9fcfa4..60bc03b 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/talents.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/talents.lua
@@ -13,6 +13,14 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  	= _G.unpack;
+local select  	= _G.select;
+local ipairs  	= _G.ipairs;
+local pairs   	= _G.pairs;
+local type 		= _G.type;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/taxi.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/taxi.lua
index 2e3c82a..45a33d1 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/taxi.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/taxi.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/timemanager.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/timemanager.lua
index 0a49a23..5c3e9df 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/timemanager.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/timemanager.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/trade.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/trade.lua
index a724c3f..c2254f3 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/trade.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/trade.lua
@@ -13,6 +13,14 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  	= _G.unpack;
+local select  	= _G.select;
+local ipairs  	= _G.ipairs;
+local pairs   	= _G.pairs;
+local type 		= _G.type;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tradeskill.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tradeskill.lua
index 77634d4..bd6dbb2 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tradeskill.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/tradeskill.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/trainer.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/trainer.lua
index f5dbb31..7a8e06d 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/trainer.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/trainer.lua
@@ -13,6 +13,14 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  	= _G.unpack;
+local select  	= _G.select;
+local ipairs  	= _G.ipairs;
+local pairs   	= _G.pairs;
+local type 		= _G.type;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/transmog.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/transmog.lua
index a91f476..45762a2 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/transmog.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/transmog.lua
@@ -13,6 +13,14 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  	= _G.unpack;
+local select  	= _G.select;
+local ipairs  	= _G.ipairs;
+local pairs   	= _G.pairs;
+local type 		= _G.type;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/voidstorage.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/voidstorage.lua
index 981f67e..629092b 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/voidstorage.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/voidstorage.lua
@@ -13,6 +13,14 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack    = _G.unpack;
+local select    = _G.select;
+local ipairs    = _G.ipairs;
+local pairs     = _G.pairs;
+local type    = _G.type;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldmap.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldmap.lua
index c38c8b2..84f48e2 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldmap.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldmap.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
@@ -23,7 +28,8 @@ HELPERS
 ##########################################################
 ]]--
 local function AdjustMapLevel()
-  if InCombatLockdown()then return end
+  if InCombatLockdown()then return end
+    local WorldMapFrame = _G.WorldMapFrame;
     WorldMapFrame:SetFrameLevel(4)
     WorldMapDetailFrame:SetFrameLevel(6)
     WorldMapFrame:SetFrameStrata('HIGH')
@@ -32,12 +38,14 @@ local function AdjustMapLevel()
 end

 local function WorldMap_SmallView()
+  local WorldMapFrame = _G.WorldMapFrame;
   WorldMapFrame.Panel:ClearAllPoints()
   WorldMapFrame.Panel:WrapOuter(WorldMapFrame, 4, 4)
   WorldMapFrame.Panel.Panel:WrapOuter(WorldMapFrame.Panel)
 end

 local function WorldMap_FullView()
+  local WorldMapFrame = _G.WorldMapFrame;
   WorldMapFrame.Panel:ClearAllPoints()

   if(SV.GameVersion >= 60000) then
@@ -84,6 +92,8 @@ local function WorldMap_QuestView()
 end

 local function StripQuestMapFrame()
+  local WorldMapFrame = _G.WorldMapFrame;
+
   WorldMapFrame.BorderFrame:RemoveTextures(true)
   WorldMapFrame.BorderFrame.ButtonFrameEdge:SetTexture(0,0,0,0)
   WorldMapFrame.BorderFrame.InsetBorderTop:SetTexture(0,0,0,0)
@@ -137,7 +147,8 @@ local function StripQuestMapFrame()
 end

 local function WorldMap_OnShow()
-
+  local WorldMapFrame = _G.WorldMapFrame;
+
   if(SV.GameVersion >= 60000) then
     --StripQuestMapFrame()
     if WORLDMAP_SETTINGS.size == WORLDMAP_FULLMAP_SIZE then
diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldstate.lua b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldstate.lua
index 29182bd..6a89c98 100644
--- a/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldstate.lua
+++ b/Interface/AddOns/SVUI_StyleOMatic/components/blizzard/worldstate.lua
@@ -13,6 +13,11 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_       #
 S U P E R - V I L L A I N - U I   By: Munglunch                              #
 ##############################################################################
 --]]
+--[[ GLOBALS ]]--
+local _G = _G;
+local unpack  = _G.unpack;
+local select  = _G.select;
+--[[ ADDON ]]--
 local SV = _G.SVUI;
 local L = SV.L;
 local STYLE = select(2, ...);
diff --git a/Interface/AddOns/SVUI_TrackOMatic/components/unitframe_gps.lua b/Interface/AddOns/SVUI_TrackOMatic/components/unitframe_gps.lua
index b058285..0e68778 100644
--- a/Interface/AddOns/SVUI_TrackOMatic/components/unitframe_gps.lua
+++ b/Interface/AddOns/SVUI_TrackOMatic/components/unitframe_gps.lua
@@ -51,6 +51,10 @@ local oUF = oUF_Villain or oUF
 assert(oUF, 'oUF not loaded')

 local PLUGIN = select(2, ...);
+local Schema = PLUGIN.Schema;
+
+local SV = _G["SVUI"];
+local L = SV.L;

 local GPS_UpdateHandler = CreateFrame("Frame");

@@ -59,6 +63,7 @@ local _FRAMES, _PROXIMITY = {}, {}
 local minThrottle = 0.02
 local numArrows, inRange, GPS
 local Triangulate = Triangulate
+local NewHook = hooksecurefunc;
 --[[
 ##########################################################
 oUF TAGS
@@ -231,7 +236,7 @@ local Update = function(self, elapsed)
 				GPS = object.GPS
 				local unit = object.unit
 				if(unit) then
-					if(GPS.PreUpdate) then GPS:PreUpdate(frame) end
+					if(GPS.PreUpdate) then GPS:PreUpdate(object) end

 					local outOfRange = GPS.outOfRange and UnitInRange(unit) or false

@@ -269,7 +274,7 @@ local Update = function(self, elapsed)
 								GPS.Text:SetText(floor(distance))
 							end

-							if(GPS.PostUpdate) then GPS:PostUpdate(frame, distance, angle) end
+							if(GPS.PostUpdate) then GPS:PostUpdate(object, distance, angle) end
 							numArrows = numArrows + 1
 						end
 					end