Fix root response handling code