Fix error that caused stderr to be lost