Well, I can't find a specific symptom that exactly matches your description.

But I have a feeling it has something to do with many of the pins being in Analog mode.

Try adding ...
Code:
ANSEL = 0
<br>