Fix SSL redirect logic.