Today I found out that the code I wrote works when I tried debugger mode in MPLab. When it was in programmer mode, it didn't. So, I am thinking that there's something wrong with the PIC's ...
I tried to use an EiBot board from Sparkfun for my own project (https://www.sparkfun.com/products/10025). Basically, Its a PIC18F46J50 board with ICSP pin out (5 pins).