fix more scoping bugs

minimal testcases:

local a = {}
function a:b()
	return self -- false global
end

repeat
	local b = true
until b -- false global; this loop executes only once

local a = function (b) end
print(b) -- undetected global