Code reflowing to comply with PEP8

Fix indentation on some lines and split long lines.