Some fixes and pep8