Fixed lint errors, also fixed global variables