Improving the accuracy of the generalized Schur algorithm