Try using an external pullup resistor. Data sheet says:
"Three pins of PORTB are multiplexed with the In-Circuit
Debugger and Low-Voltage Programming function:
RB3/PGM, RB6/PGC and RB7/PGD."
and
"Each of the PORTB pins has a weak internal pull-up. A
single control bit can turn on all the pull-ups."
So I would suggest using an extrenal pullup to +5V through a 4.7 to 10 K resistros, I went nuts over the behaviour of B5 which once pulled to low via a switch always kept floating, despite the fact that internal pullups were defined in the firmare, while I was making the code in picbasic, then a friend of mine who did the coding in C, told me to use an external pullup and that resolved the issue once and for all.