Another assume i made is that if i upload a longer program to the chip and then a shorter one, part of the longer program still remains in the memory but this is not issue since the new shorter code has its end coded or a infinite loop at the end. Is this rigth?

I assumed this becouse there are no option to empty the memory in the program.
I am not sure if it will cause a problem, but I think it will if the chip is not erased.

In MPLAB on the toolbar, configure, settingins, and the the Program Loading tab. Clear everything.