pep8 and deprecation warnings
update and fix some tests