Mann Whitney U Test problem

#1
Hi!
I have worked out Mann Whitney U Tests by hand, and afterwards checked them on internet computer programmes, except that one of them doesn't match at all and I don't understand why. Could it be because I've worked out the rankings wrong, as there are loads of zero scores.
There are two groups, the source numbers in each being:
GROUP 1: Number 4 4 0 0 0 0 0
Rank 8.5 8.5 17 17 17 17 17

GROUP 2: Number 51 40 24 21 20 12 9 3 1 1 0 0 0 0
Rank 1 2 3 4 5 6 7 10 11 12 17 17 17 17

(just so you know, the numbers refer to how many times an individual chimpanzee gave a dramatic display)
I ranked the zeros by adding up the zero ranks and dividing by 9 (the number of zeros) to make them all equal-17th out of 21. Is this correct? By hand I get z=-2.313 with a P=0.0104 (it's a one-tailed test). But on the computer I put the source numbers in, press the magic button and it comes out with z = 1.86512 with P=0.0310 (one tailed). Aaaargh. I don't understand.
Any help would be very much appreciated (also with my previous post begging for help with a Shannon-Weaver diversity index for my same dissertation).

Thanks.