Tweaks to help with redirect handling