Fixed pylint and unit test errors