Fixed broken test discovery and pep8/pylint issues