Fix newlines and more pyflakes cleanup