Some tweaks and pep8