Fix tests and pylint violations