Fix redirect when finishing test