Linted code and various fixes