Aha, thanks to you and ufo for the explanation. I think the problem was that I was thinking about it in complex exponential notation. If I had done it in matrix form, the cancellation of the two amplitudes of the |0> state would have been much more obvious.