Error redirection partially working