Fixed redirect bug causing window.history.back() to redirect endlessly.