Redirect fixes and pep8 related corrections.
Merge pull request #787 from thezoggy/dev--redirect_fixes

Redirect fixes and pep8 related corrections.