Hi,
Well sounds like you have a Pickit2 clone so that should work fine with a 877A.
You are always better to include the Cofiguration code and EEProm Data in your main program code and burn it all together - never had any problems doing that.
You can often find that the Pk2 seems to behave strangely with weird error messages, like need to download program etc, but this is usually down to the users doing things wrong, once you do things correctly its as simple as abc, really !
ICSP works fine given the basic connections detailed in that Pk2 pdf.
On a 877A you must have both pos pins 11/32 and both neg 12/31 pins connected and just a 100nf across them, not some massive electrolytic.
If you cannot reorganise your code so RB6 and RB7 programming pins are free, then a simple double pole switch can be used so you just switch over to programming mode or run mode on pins RB6&7
Its well worth sorting that out for two reasons, if something is burning out your Pk2 / 877A you have a serious wiring /component problem still around, plus you will find the Pk2 Debugger a very useful tool to use as your code becomes more complex, it uses the same connections as ICSP.