Fixed a bunch of typos, incorrect variable names and linting errors