VE-821: Fix incorrect comparision against "undefined", also minor cleanup to variables name.
Merge pull request #3065 from Wikia/VE-821-1

VE-821: Fix incorrect comparision against "undefined", also minor cleanu...