Tie your pgm pin to gnd using a 10k resistor.
i had it that when pgm was floating, even if lvp was turned off, that when a relay was switched in the near vicinity, that the pic would try to go to programming mode and lock up
Also put a diode and 10k resistor in series from your supply to the mclr pin. The stripe of the diode must point towards the mclr pin. That pulls the mclr high, but blocks programming voltage from coming back to the supply
Also, if port pins are not used, set them as outputs, stops them from picking up interference.