Strict mode enforced and some implicit vars fixed