Fixed a bunch of typos and bad practices