Another silly thought. Some times you can open a hex file in the melabs programmer and it's not the latest. The compiler may be storing it in a different directory. You may be opening an older version of your hex file from another directory. As much as you modify your basic code, you keep programing the chip with the same hex. Recompile and check the date and time stamp on the file. I have used that chip before and it is not difficult to get working. If you post your code, someone can compile it and see whats going on.
Bookmarks