fix test and some pylint warnings