Fixing globals and linting issues