Fix stderr capture