Check the data sheet for this PIC. Several PORTB pins are analog intputs at power-up, and
you'll need to write to OSCCON to configure it for 8MHz internal.

The default value in OSCCON at reset is for 1MHz.