Fixed stdout redirection