Fixed removeServerUri to prevent redirect