Did you set the OSC type in PBP *.inc file for this chip.

And if you did what did you set it for.

Or you can do it on this line that I do not see in the new code.

@ DEVICE MCLR_OFF, PROTECT_OFF, WDT_OFF,_XT_OSC

Double check the data sheet on this, I do not have it in front of me.