Pep8 and deprication fixes