Fixes a lot of linting errors and warnings