added check for global memory in tests, and removed offenders by using var as intended