Has the behaviour got anything to do with RB0/INT being used as an interrupt in your program? Maybe you can poll RB0 to confirm if this is what is causing the malfunction.