Several of the pins you are using also have an analogue input function, which is enabled by default on reset. For instance, RB3 will be the AN9 ADC input.
See the data sheet (page 116) for details of how to enable them for digital I/O. You need to set some bits in your C program; I use this for PORTA on the 18F4520:
ADCON1 = 0x0F;
ADCON1 = 0x0F;