Fix lint errors including use of `global`