One idea I have is maybe it is required also to declare the encoder pins as inputs.
I entered AdaEncoder::addEncoder in to bing,
http://www.arduino.cc/playground/Main/RotaryEncoders#Example3
and there is such a decleration.
If I have problems with devices worked via shifting registers, I comment out code,
and try to track down the problem, for instance tagging a LED+4.7kOhm to the register (just a little solder), and then I try to control this LED individually.
If the inputs decleration is not the cause, I'd try to output the "clicks" variable directly as bitstream.