Apply PEP8 guidelines

Adding/removing some spaces, blank lines here and there to make the code
conform PEP8 guidelines.