be sure you set LVP to OFF, BOD to ON, PWRT to ON in your config fuses.

I doesn't do magic, but it help in most cases.