Fix bug causing site to always redirect to admin page