Add linter; fix problems exposed by linter