You probably should check that stderr is empty too.