you need to disable analog comparator on PORTD<3:0> to avoid odd results first.
CMCON=7

about now?