Fixing some stuff up to prepare for redirection.