Redirect fixes and pep8 related corrections.